unsigned char EnableRegVars = 0; /* Enable register variables */
unsigned char AllowRegVarAddr = 0; /* Allow taking addresses of register vars */
unsigned char RegVarsToCallStack= 0; /* Save reg variables on call stack */
-unsigned char LocalsAreStatic = 0; /* Make local variables static */
+unsigned char StaticLocals = 0; /* Make local variables static */
unsigned char SignedChars = 0; /* Make characters signed by default */
unsigned char Verbose = 0; /* Verbose flag */
unsigned char AddSource = 0; /* Add source lines as comments */
extern unsigned char EnableRegVars; /* Enable register variables */
extern unsigned char AllowRegVarAddr; /* Allow taking addresses of register vars */
extern unsigned char RegVarsToCallStack; /* Save reg variables on call stack */
-extern unsigned char LocalsAreStatic; /* Make local variables static */
+extern unsigned char StaticLocals; /* Make local variables static */
extern unsigned char SignedChars; /* Make characters signed by default */
extern unsigned char Verbose; /* Verbose flag */
extern unsigned char AddSource; /* Add source lines as comments */
" --help\t\tHelp (this text)\n"
" --include-dir dir\tSet an include directory search path\n"
" --signed-chars\tDefault characters are signed\n"
+ " --static-locals\tMake local variables static\n"
" --target sys\t\tSet the target system\n"
" --verbose\t\tIncrease verbosity\n"
" --version\t\tPrint the compiler version number\n",
+static void OptStaticLocals (const char* Opt, const char* Arg)
+/* Place local variables in static storage */
+{
+ StaticLocals = 1;
+}
+
+
+
static void OptTarget (const char* Opt, const char* Arg)
/* Set the target system */
{
{
/* Program long options */
static const LongOpt OptTab[] = {
- { "--add-source", 0, OptAddSource },
+ { "--add-source", 0, OptAddSource },
{ "--ansi", 0, OptAnsi },
{ "--cpu", 1, OptCPU },
{ "--debug-info", 0, OptDebugInfo },
{ "--help", 0, OptHelp },
{ "--include-dir", 1, OptIncludeDir },
{ "--signed-chars", 0, OptSignedChars },
+ { "--static-locals", 0, OptStaticLocals },
{ "--target", 1, OptTarget },
{ "--verbose", 0, OptVerbose },
{ "--version", 0, OptVersion },
while (*P) {
switch (*P++) {
case 'l':
- LocalsAreStatic = 1;
+ OptStaticLocals (Arg, 0);
break;
+ default:
+ UnknownOption (Arg);
+ break;
}
}
break;