* src/SDCCmain.c (parseCmdLine): Added support for -Wp.
authormichaelh <michaelh@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 5 Nov 2001 01:52:21 +0000 (01:52 +0000)
committermichaelh <michaelh@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 5 Nov 2001 01:52:21 +0000 (01:52 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1503 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCCmain.c
support/Util/BuildCmd.c
support/Util/BuildCmd.h
support/regression/tests/bug-478094.c

index 0700abecd3df54244688ab7dd8a8f9aa7a18c8a8..9d11a0c0616cb1e88c9f03aa27a741155b33ac5d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2001-11-04  Michael Hope  <michaelh@juju.net.nz>
 
+       * src/SDCCmain.c (parseCmdLine): Added support for -Wp.
+
        * support/regression/tests/bug-478094.c: Added.
 
        * src/z80/gen.c (commitPair): Fixed silly gbz80/z80 commit to static bug.
index 705e408f2a8a711981d76f5899485a408311e226..3673b509262976590751ad5ca0dcbcda3b2e122f 100644 (file)
@@ -146,7 +146,7 @@ optionsTable[] = {
     { 'M',  NULL,                   NULL, "Preprocessor option" },
     { 'V',  NULL,                   &verboseExec, "Execute verbosely.  Show sub commands as they are run" },
     { 'S',  NULL,                   &noAssemble, "Compile only; do not assemble or link" },
-    { 'W',  NULL,                   NULL, "Pass through options to the assembler (a) or linker (l)" },
+    { 'W',  NULL,                   NULL, "Pass through options to the pre-processor (p), assembler (a) or linker (l)" },
     { 'L',  NULL,                   NULL, "Add the next field to the library search path" },
     { 'l',  NULL,                   NULL, "Include the given library in the link" },
     { 0,    OPTION_LARGE_MODEL,     NULL, "external data space is used" },
@@ -935,23 +935,25 @@ parseCmdLine (int argc, char **argv)
                 break;
 
            case 'W':
+              /* pre-processer options */
+              if (argv[i][2] == 'p')
+                {
+                  parseWithComma ((char **)preArgv, getStringArg("-Wp", argv, &i, argc));
+                }
              /* linker options */
-             if (argv[i][2] == 'l')
+             else if (argv[i][2] == 'l')
                {
-                    parseWithComma(linkOptions, getStringArg("-Wl", argv, &i, argc));
-               }
-             else
-               {
-                 /* assembler options */
-                 if (argv[i][2] == 'a')
-                   {
-                       parseWithComma ((char **) asmOptions, getStringArg("-Wa", argv, &i, argc));
-                   }
-                 else
-                   {
-                     werror (W_UNKNOWN_OPTION, argv[i]);
-                   }
+                  parseWithComma(linkOptions, getStringArg("-Wl", argv, &i, argc));
                }
+              /* assembler options */
+             else if (argv[i][2] == 'a')
+                {
+                  parseWithComma ((char **) asmOptions, getStringArg("-Wa", argv, &i, argc));
+                }
+              else
+                {
+                  werror (W_UNKNOWN_OPTION, argv[i]);
+                }
              break;
 
            case 'v':
index 2d0b051f4d2e82200310ee5512756ce85c61dfc1..e45cece67be6dd7ea1c52ca0e14e6a42ad4c60eb 100644 (file)
@@ -31,7 +31,7 @@
 void
 buildCmdLine (char *into, const char **cmds,
              const char *p1, const char *p2,
-             const char *p3, const char **list)
+             const char *p3, const char * const *list)
 {
   const char *p, *from;
 
@@ -66,7 +66,7 @@ buildCmdLine (char *into, const char **cmds,
              break;
            case 'l':
              {
-               const char **tmp = list;
+               const char *const *tmp = list;
                if (tmp)
                  {
                    while (*tmp)
index 0dc403e0c78fafd7baa5fcf9cb8cce3cd96a802b..34dd2cc44c3fdc99b4f56b0fceb5b5f5d64ae8de 100644 (file)
@@ -29,6 +29,6 @@
 void
 buildCmdLine (char *into, const char **cmds,
              const char *p1, const char *p2,
-             const char *p3, const char **list) ;
+             const char *p3, const char * const *list) ;
 
 #endif
index c2de561818307058a6b3ae8c42203b52ec1bff5c..10158421f62d3a401763bf479b67166af0488b4b 100644 (file)
@@ -6,7 +6,10 @@
 
 int foo = 16; 
 
-extern void f( int x ); 
+void f( int x )
+{
+  UNUSED(x);
+}
 
 void g(int bar) 
 {