]> git.sur5r.net Git - cc65/commitdiff
Fix problem with changed syntax of option -W for the compiler: -W will now
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 1 May 2011 17:56:44 +0000 (17:56 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 1 May 2011 17:56:44 +0000 (17:56 +0000)
only be passed to the compiler together with all warning names.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5006 b7a2c559-68d2-44c3-8de9-860c34a00d81

doc/cl65.sgml
src/cl65/main.c

index 574d90ad65b6c80062c20e4b688af31b7b88bb29..b65f7f69bb522c9c6e2baaef52aec4f1955095ba 100644 (file)
@@ -60,7 +60,7 @@ Short options:
   -S                            Compile but don't assemble and link
   -T                            Include source as comment
   -V                            Print the version number
-  -W                            Suppress warnings
+  -W name[,...]                 Supress compiler warnings
   -Wa options                   Pass options to the assembler
   -Wl options                   Pass options to the linker
 
index cf22adb196502c620ce3cea301bc7448d4b6ac1b..0ef25af326dff7031234f88b145eca5f2da24762 100644 (file)
@@ -690,7 +690,7 @@ static void Usage (void)
             "  -S\t\t\t\tCompile but don't assemble and link\n"
             "  -T\t\t\t\tInclude source as comment\n"
             "  -V\t\t\t\tPrint the version number\n"
-            "  -W\t\t\t\tSuppress warnings\n"
+                   "  -W name[,...]\t\t\tSupress compiler warnings\n"
             "  -Wa options\t\t\tPass options to the assembler\n"
             "  -Wl options\t\t\tPass options to the linker\n"
             "\n"
@@ -766,7 +766,7 @@ static void OptAsmArgs (const char* Opt attribute ((unused)), const char* Arg)
 }
 
 
-                                                            
+
 static void OptAsmDefine (const char* Opt attribute ((unused)), const char* Arg)
 /* Define an assembler symbol (assembler) */
 {
@@ -1351,28 +1351,18 @@ int main (int argc, char* argv [])
                    OptVersion (Arg, 0);
                    break;
 
-               case 'W':
-                    switch (Arg[2]) {
-
-                        case 'a':
-                            OptAsmArgs (Arg, GetArg (&I, 3));
-                            break;
-
-                        case 'l':
-                            OptLdArgs (Arg, GetArg (&I, 3));
-                            break;
-
-                        case '\0':
-                            /* Suppress warnings - compiler and assembler */
-                            CmdAddArg (&CC65, "-W");
-                            CmdAddArg2 (&CA65, "-W", "0");
-                            break;
-
-                        default:
-                            UnknownOption (Arg);
-                            break;
-                    }
-                    break;
+               case 'W':
+                   if (Arg[2] == 'a' && Arg[3] == '\0') {
+                       /* -Wa: Pass options to assembler */
+                       OptAsmArgs (Arg, GetArg (&I, 3));
+                   } else if (Arg[2] == 'l' && Arg[3] == '\0') {
+                       /* -Wl: Pass options to linker */
+                       OptLdArgs (Arg, GetArg (&I, 3));
+                   } else {
+                       /* Anything else: Suppress warnings (compiler) */
+                       CmdAddArg2 (&CC65, "-W", GetArg (&I, 3));
+                   }
+                   break;
 
                case 'c':
                    /* Don't link the resulting files */