{
int i;
printVersionInfo();
- fprintf (stderr,
+ fprintf (stdout,
"Usage : sdcc [options] filename\n"
"Options :-\n"
);
for (i = 0; i < LENGTH(optionsTable); i++) {
- fprintf(stderr, " %c%c %-20s %s\n",
+ fprintf(stdout, " %c%c %-20s %s\n",
optionsTable[i].shortOpt !=0 ? '-' : ' ',
optionsTable[i].shortOpt !=0 ? optionsTable[i].shortOpt : ' ',
optionsTable[i].longOpt != NULL ? optionsTable[i].longOpt : "",
/* this is automatic */
/* if it to be placed on the stack */
- if (options.stackAuto || reentrant)
- {
-
- sym->onStack = 1;
- if (options.useXstack)
- {
- /* PENDING: stack direction for xstack */
- SPEC_OCLS (sym->etype) = xstack;
- SPEC_STAK (sym->etype) = sym->stack = (xstackPtr + 1);
- xstackPtr += getSize (sym->type);
- }
- else
- {
- SPEC_OCLS (sym->etype) = istack;
- if (port->stack.direction > 0)
- {
- SPEC_STAK (sym->etype) = sym->stack = (stackPtr + 1);
- stackPtr += getSize (sym->type);
- }
- else
- {
- stackPtr -= getSize (sym->type);
- SPEC_STAK (sym->etype) = sym->stack = stackPtr;
- }
- }
- allocIntoSeg (sym);
- return;
+ if (options.stackAuto || reentrant) {
+ sym->onStack = 1;
+ if (options.useXstack) {
+ /* PENDING: stack direction for xstack */
+ SPEC_OCLS (sym->etype) = xstack;
+ SPEC_STAK (sym->etype) = sym->stack = (xstackPtr + 1);
+ xstackPtr += getSize (sym->type);
+ } else {
+ SPEC_OCLS (sym->etype) = istack;
+ if (port->stack.direction > 0) {
+ SPEC_STAK (sym->etype) = sym->stack = (stackPtr + 1);
+ stackPtr += getSize (sym->type);
+ } else {
+ stackPtr -= getSize (sym->type);
+ SPEC_STAK (sym->etype) = sym->stack = stackPtr;
+ }
}
-
+ allocIntoSeg (sym);
+ return;
+ }
+
/* else depending on the storage class specified */
if (SPEC_SCLS (sym->etype) == S_XDATA)
{
sym->ival = NULL;
}
+#if 0
/* if this is an automatic symbol then */
/* storage class will be ignored and */
/* symbol will be allocated on stack/ */
werror (E_AUTO_ASSUMED, sym->name);
SPEC_SCLS (sym->etype) = S_AUTO;
}
+#else
+ /* if this is an atomatic symbol */
+ if (sym->level && (options.stackAuto || reentrant)) {
+ if ((SPEC_SCLS (sym->etype) == S_AUTO ||
+ SPEC_SCLS (sym->etype) == S_FIXED ||
+ SPEC_SCLS (sym->etype) == S_REGISTER ||
+ SPEC_SCLS (sym->etype) == S_STACK ||
+ SPEC_SCLS (sym->etype) == S_XSTACK)) {
+ SPEC_SCLS (sym->etype) = S_AUTO;
+ } else {
+ /* storage class may only be specified for statics */
+ if (!IS_STATIC(sym->etype)) {
+ werror (E_AUTO_ASSUMED, sym->name);
+ }
+ }
+ }
+#endif
/* automatic symbols cannot be given */
/* an absolute address ignore it */
" a 'sfr','sbit' storage class, initial value ignored '%s'" },
{ E_INIT_IGNORED, ERROR_LEVEL_WARNING,
"Variable in the storage class cannot be initialized.'%s'" },
-{ E_AUTO_ASSUMED, ERROR_LEVEL_WARNING,
- "storage class not allowed for automatic variable '%s' in reentrant function" },
+{ E_AUTO_ASSUMED, ERROR_LEVEL_ERROR,
+ "storage class not allowed for automatic variable '%s' in reentrant function unless static" },
{ E_AUTO_ABSA, ERROR_LEVEL_ERROR,
"absolute address not allowed for automatic var '%s' in reentrant function " },
{ E_INIT_WRONG, ERROR_LEVEL_WARNING,