]> git.sur5r.net Git - cc65/blobdiff - src/cc65/main.c
Fixed two compiler warnings.
[cc65] / src / cc65 / main.c
index 63081855acd8257985bd33cfc7a068fc00eda797..4165bc8575e6d93a5b55d55c7a3f8048e6bf2c50 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000-2010, Ullrich von Bassewitz                                      */
+/* (C) 2000-2011, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -92,7 +92,7 @@ static void Usage (void)
             "  -Os\t\t\t\tInline some known functions\n"
             "  -T\t\t\t\tInclude source as comment\n"
             "  -V\t\t\t\tPrint the compiler version number\n"
-            "  -W\t\t\t\tSuppress warnings\n"
+            "  -W warning[,...]\t\tSuppress warnings\n"
             "  -d\t\t\t\tDebug mode\n"
             "  -g\t\t\t\tAdd debug info to object file\n"
             "  -h\t\t\t\tHelp (this text)\n"
@@ -123,6 +123,7 @@ static void Usage (void)
             "  --help\t\t\tHelp (this text)\n"
             "  --include-dir dir\t\tSet an include directory search path\n"
             "  --list-opt-steps\t\tList all optimizer steps and exit\n"
+            "  --list-warnings\t\tList available warning types for -W\n"
             "  --local-strings\t\tEmit string literals immediately\n"
             "  --memory-model model\t\tSet the memory model\n"
             "  --register-space b\t\tSet space available for register variables\n"
@@ -209,9 +210,15 @@ static void SetSys (const char* Sys)
             DefineNumericMacro ("__APPLE2ENH__", 1);
            break;
 
-       case TGT_GEOS:
+       case TGT_GEOS_CBM:
            /* Do not handle as a CBM system */
            DefineNumericMacro ("__GEOS__", 1);
+           DefineNumericMacro ("__GEOS_CBM__", 1);
+           break;
+
+       case TGT_GEOS_APPLE:
+           DefineNumericMacro ("__GEOS__", 1);
+           DefineNumericMacro ("__GEOS_APPLE__", 1);
            break;
 
        case TGT_LUNIX:
@@ -544,7 +551,8 @@ static void OptHelp (const char* Opt attribute ((unused)),
 static void OptIncludeDir (const char* Opt attribute ((unused)), const char* Arg)
 /* Add an include search path */
 {
-    AddIncludePath (Arg, INC_SYS | INC_USER);
+    AddSearchPath (SysIncSearchPath, Arg);
+    AddSearchPath (UsrIncSearchPath, Arg);
 }
 
 
@@ -562,6 +570,19 @@ static void OptListOptSteps (const char* Opt attribute ((unused)),
 
 
 
+static void OptListWarnings (const char* Opt attribute ((unused)),
+                            const char* Arg attribute ((unused)))
+/* List all warning types */
+{
+    /* List the warnings */
+    ListWarnings (stdout);
+
+    /* Terminate */
+    exit (EXIT_SUCCESS);
+}
+
+
+
 static void OptLocalStrings (const char* Opt attribute ((unused)),
                             const char* Arg attribute ((unused)))
 /* Emit string literals immediately */
@@ -768,6 +789,7 @@ int main (int argc, char* argv[])
        { "--help",             0,      OptHelp                 },
        { "--include-dir",      1,      OptIncludeDir           },
        { "--list-opt-steps",   0,      OptListOptSteps         },
+               { "--list-warnings",    0,      OptListWarnings         },
         { "--local-strings",    0,      OptLocalStrings         },
         { "--memory-model",     1,      OptMemoryModel          },
         { "--register-space",   1,      OptRegisterSpace        },
@@ -934,7 +956,7 @@ int main (int argc, char* argv[])
     /* If no CPU given, use the default CPU for the target */
     if (CPU == CPU_UNKNOWN) {
         if (Target != TGT_UNKNOWN) {
-            CPU = DefaultCPU[Target];
+            CPU = GetTargetProperties (Target)->DefaultCPU;
         } else {
             CPU = CPU_6502;
         }