Print this page
9868 unused cw translations should be removed

@@ -35,11 +35,11 @@
  * Since the translation is inexact, this is something of a work-in-progress.
  *
  */
 
 /* If you modify this file, you must increment CW_VERSION */
-#define CW_VERSION      "2.0"
+#define CW_VERSION      "3.0"
 
 /*
  * -#           Verbose mode
  * -###         Show compiler commands built by driver, no compilation
  * -A<name[(tokens)]>   Preprocessor predicate assertion

@@ -54,12 +54,10 @@
  * -errtags=<a> Display messages with tags a(no, yes)
  * -errwarn=<t> Treats warnings specified by tags t(%none, %all, <tag list>)
  *              as errors
  * -fast        Optimize using a selection of options
  * -fd          Report old-style function definitions and declarations
- * -features=zla        Allow zero-length arrays
- * -flags       Show this summary of compiler options
  * -fnonstd     Initialize floating-point hardware to non-standard preferences
  * -fns[=<yes|no>] Select non-standard floating point mode
  * -fprecision=<p> Set FP rounding precision mode p(single, double, extended)
  * -fround=<r>  Select the IEEE rounding mode in effect at startup
  * -fsimple[=<n>] Select floating-point optimization preferences <n>

@@ -82,21 +80,16 @@
  * -mr,"string" Remove all strings and append "string" to .comment section
  * -mt          Specify options needed when compiling multi-threaded code
  * -native      Find available processor, generate code accordingly
  * -nofstore    Do not force floating pt. values to target precision
  *              on assignment
- * -nolib       Same as -xnolib
- * -noqueue     Disable queuing of compiler license requests
  * -norunpath   Do not build in a runtime path for shared libraries
  * -O           Use default optimization level (-xO2 or -xO3. Check man page.)
  * -o <outputfile> Set name of output file to <outputfile>
  * -P           Compile source through preprocessor only, output to .i  file
- * -PIC         Alias for -KPIC or -xcode=pic32
  * -p           Compile for profiling with prof
- * -pic         Alias for -Kpic or -xcode=pic13
  * -Q[y|n]      Emit/don't emit identification info to output file
- * -qp          Compile for profiling with prof
  * -R<dir[:dir]> Build runtime search path list into executable
  * -S           Compile and only generate assembly code (.s)
  * -s           Strip symbol table from the executable file
  * -t           Turn off duplicate symbol warnings when linking
  * -U<name>     Delete initial definition of preprocessor symbol <name>

@@ -104,20 +97,16 @@
  * -v           Do stricter semantic checking
  * -W<c>,<arg>  Pass <arg> to specified component <c> (a,l,m,p,0,2,h,i,u)
  * -w           Suppress compiler warning messages
  * -Xa          Compile assuming ANSI C conformance, allow K & R extensions
  *              (default mode)
- * -Xc          Compile assuming strict ANSI C conformance
  * -Xs          Compile assuming (pre-ANSI) K & R C style code
  * -Xt          Compile assuming K & R conformance, allow ANSI C
- * -x386        Generate code for the 80386 processor
- * -x486        Generate code for the 80486 processor
  * -xarch=<a>   Specify target architecture instruction set
  * -xbuiltin[=<b>] When profitable inline, or substitute intrinisic functions
  *              for system functions, b={%all,%none}
  * -xCC         Accept C++ style comments
- * -xchar_byte_order=<o> Specify multi-char byte order <o> (default, high, low)
  * -xchip=<c>   Specify the target processor for use by the optimizer
  * -xcode=<c>   Generate different code for forming addresses
  * -xcrossfile[=<n>] Enable optimization and inlining across source files,
  *              n={0|1}
  * -xe          Perform only syntax/semantic checking, no code generation

@@ -131,19 +120,13 @@
  * -xlibmieee   Force IEEE 754 return values for math routines in
  *              exceptional cases
  * -xlibmil     Inline selected libm math routines for optimization
  * -xlic_lib=sunperf    Link in the Sun supplied performance libraries
  * -xlicinfo    Show license server information
- * -xM          Generate makefile dependencies
- * -xM1         Generate makefile dependencies, but exclude /usr/include
  * -xmaxopt=[off,1,2,3,4,5] maximum optimization level allowed on #pragma opt
- * -xnolib      Do not link with default system libraries
- * -xnolibmil   Cancel -xlibmil on command line
  * -xO<n>       Generate optimized code (n={1|2|3|4|5})
  * -xP          Print prototypes for function definitions
- * -xpentium    Generate code for the pentium processor
- * -xpg         Compile for profiling with gprof
  * -xprofile=<p> Collect data for a profile or use a profile to optimize
  *              <p>={{collect,use}[:<path>],tcov}
  * -xregs=<r>   Control register allocation
  * -xs          Allow debugging without object (.o) files
  * -xsb         Compile for use with the WorkShop source browser

@@ -153,12 +136,10 @@
  * -xspace      Do not do optimizations that increase code size
  * -xstrconst   Place string literals into read-only data segment
  * -xtarget=<t> Specify target system for optimization
  * -xtemp=<dir> Set directory for temporary files to <dir>
  * -xtime       Report the execution time for each compilation phase
- * -xtransition Emit warnings for differences between K&R C and ANSI C
- * -xtrigraphs[=<yes|no>] Enable|disable trigraph translation
  * -xunroll=n   Enable unrolling loops n times where possible
  * -Y<c>,<dir>  Specify <dir> for location of component <c> (a,l,m,p,0,h,i,u)
  * -YA,<dir>    Change default directory searched for components
  * -YI,<dir>    Change default directory searched for include files
  * -YP,<dir>    Change default directory for finding libraries files

@@ -182,12 +163,10 @@
  * -erroff=E_EMPTY_TRANSLATION_UNIT ignore
  * -errtags=%all                -Wall
  * -errwarn=%all                -Werror else -Wno-error
  * -fast                        error
  * -fd                          error
- * -features=zla                ignore
- * -flags                       --help
  * -fnonstd                     error
  * -fns[=<yes|no>]              error
  * -fprecision=<p>              error
  * -fround=<r>                  error
  * -fsimple[=<n>]               error

@@ -210,20 +189,16 @@
  * -mr,"string"                 error
  * -mt                          -D_REENTRANT
  * -native                      error
  * -nofstore                    error
  * -nolib                       -nodefaultlibs
- * -noqueue                     ignore
  * -norunpath                   ignore
  * -O                           -O1 (Check the man page to be certain)
  * -o <outputfile>              pass-thru
  * -P                           -E -o filename.i (or error)
- * -PIC                         -fPIC (C++ only)
  * -p                           pass-thru
- * -pic                         -fpic (C++ only)
  * -Q[y|n]                      error
- * -qp                          -p
  * -R<dir[:dir]>                pass-thru
  * -S                           pass-thru
  * -s                           -Wl,-s
  * -t                           -Wl,-t
  * -U<name>                     pass-thru

@@ -231,24 +206,19 @@
  * -v                           -Wall
  * -Wa,<arg>                    pass-thru
  * -Wp,<arg>                    pass-thru except -xc99=<a>
  * -Wl,<arg>                    pass-thru
  * -W{m,0,2,h,i,u>              error/ignore
- * -Wu,-xmodel=kernel           -ffreestanding -mcmodel=kernel -mno-red-zone
  * -xmodel=kernel               -ffreestanding -mcmodel=kernel -mno-red-zone
  * -Wu,-save_args               -msave-args
  * -w                           pass-thru
  * -Xa                          -std=iso9899:199409 or -ansi
- * -Xc                          -ansi -pedantic
  * -Xt                          error
  * -Xs                          -traditional -std=c89
- * -x386                        -march=i386 (x86 only)
- * -x486                        -march=i486 (x86 only)
  * -xarch=<a>                   table
  * -xbuiltin[=<b>]              -fbuiltin (-fno-builtin otherwise)
  * -xCC                         ignore
- * -xchar_byte_order=<o>        error
  * -xchip=<c>                   table
  * -xcode=<c>                   table
  * -xdebugformat=<format>       ignore (always use dwarf-2 for gcc)
  * -xcrossfile[=<n>]            ignore
  * -xe                          error

@@ -258,19 +228,13 @@
  * -xildon                      ignore
  * -xinline                     ignore
  * -xlibmieee                   error
  * -xlibmil                     error
  * -xlic_lib=sunperf            error
- * -xM                          -M
- * -xM1                         -MM
  * -xmaxopt=[...]               error
- * -xnolib                      -nodefaultlibs
- * -xnolibmil                   error
  * -xO<n>                       -O<n>
  * -xP                          error
- * -xpentium                    -march=pentium (x86 only)
- * -xpg                         error
  * -xprofile=<p>                error
  * -xregs=<r>                   table
  * -xs                          error
  * -xsb                         error
  * -xsbfast                     error

@@ -279,11 +243,10 @@
  * -xstrconst                   ignore
  * -xtarget=<t>                 table
  * -xtemp=<dir>                 error
  * -xtime                       error
  * -xtransition                 -Wtransition
- * -xtrigraphs=<yes|no>         -trigraphs -notrigraphs
  * -xunroll=n                   error
  * -W0,-xdbggen=no%usedonly     -fno-eliminate-unused-debug-symbols
  *                              -fno-eliminate-unused-debug-types
  * -Y<c>,<dir>                  error
  * -YA,<dir>                    error

@@ -525,22 +488,10 @@
 Xamode(struct aelist __unused *h)
 {
 }
 
 static void
-Xcmode(struct aelist *h)
-{
-        static int xconce;
-
-        if (xconce++)
-                return;
-
-        newae(h, "-ansi");
-        newae(h, "-pedantic-errors");
-}
-
-static void
 Xsmode(struct aelist *h)
 {
         static int xsonce;
 
         if (xsonce++)

@@ -717,27 +668,10 @@
                         if (strcmp(arg, "-xwe") == 0) {
                                 /* turn warnings into errors */
                                 newae(ctx->i_ae, "-Werror");
                                 continue;
                         }
-                        if (strcmp(arg, "-noex") == 0) {
-                                /* no exceptions */
-                                newae(ctx->i_ae, "-fno-exceptions");
-                                /* no run time type descriptor information */
-                                newae(ctx->i_ae, "-fno-rtti");
-                                continue;
-                        }
-                        if (strcmp(arg, "-pic") == 0) {
-                                newae(ctx->i_ae, "-fpic");
-                                pic = 1;
-                                continue;
-                        }
-                        if (strcmp(arg, "-PIC") == 0) {
-                                newae(ctx->i_ae, "-fPIC");
-                                pic = 1;
-                                continue;
-                        }
                         if (strcmp(arg, "-norunpath") == 0) {
                                 /* gcc has no corresponding option */
                                 continue;
                         }
                         if (strcmp(arg, "-nolib") == 0) {

@@ -872,24 +806,10 @@
                                 newae(ctx->i_ae, "-Werror");
                                 break;
                         }
                         error(arg);
                         break;
-                case 'f':
-                        if (strcmp(arg, "-flags") == 0) {
-                                newae(ctx->i_ae, "--help");
-                                break;
-                        }
-                        if (strncmp(arg, "-features=zla", 13) == 0) {
-                                /*
-                                 * Accept but ignore this -- gcc allows
-                                 * zero length arrays.
-                                 */
-                                break;
-                        }
-                        error(arg);
-                        break;
                 case 'G':
                         newae(ctx->i_ae, "-shared");
                         nolibc = 1;
                         break;
                 case 'k':

@@ -962,19 +882,10 @@
                                 (void) snprintf(s, len, "-Wl,-%c%s", c, opt);
                                 newae(ctx->i_ae, s);
                                 free(s);
                         }
                         break;
-                case 'n':
-                        if (strcmp(arg, "-noqueue") == 0) {
-                                /*
-                                 * Horrid license server stuff - n/a
-                                 */
-                                break;
-                        }
-                        error(arg);
-                        break;
                 case 'O':
                         if (arglen == 1) {
                                 newae(ctx->i_ae, "-O");
                                 break;
                         }

@@ -990,17 +901,10 @@
                          */
                         newae(ctx->i_ae, "-E");
                         op = CW_O_PREPROCESS;
                         nolibc = 1;
                         break;
-                case 'q':
-                        if (strcmp(arg, "-qp") == 0) {
-                                newae(ctx->i_ae, "-p");
-                                break;
-                        }
-                        error(arg);
-                        break;
                 case 's':
                         if (arglen == 1) {
                                 newae(ctx->i_ae, "-Wl,-s");
                                 break;
                         }

@@ -1040,22 +944,10 @@
                             strncmp(arg, "-Wp,", 4) == 0 ||
                             strncmp(arg, "-Wl,", 4) == 0) {
                                 newae(ctx->i_ae, arg);
                                 break;
                         }
-                        if (strcmp(arg, "-W0,-xc99=pragma") == 0) {
-                                /* (undocumented) enables _Pragma */
-                                break;
-                        }
-                        if (strcmp(arg, "-W0,-xc99=%none") == 0) {
-                                /*
-                                 * This is a polite way of saying
-                                 * "no c99 constructs allowed!"
-                                 * For now, just accept and ignore this.
-                                 */
-                                break;
-                        }
                         if (strcmp(arg, "-W0,-noglobal") == 0 ||
                             strcmp(arg, "-W0,-xglobalstatic") == 0) {
                                 /*
                                  * gcc doesn't prefix local symbols
                                  * in debug mode, so this is not needed.

@@ -1082,17 +974,10 @@
                                  * for integer wrapping.
                                  * gcc does not need this.
                                  */
                                 break;
                         }
-                        if (strcmp(arg, "-W2,-Rcond_elim") == 0) {
-                                /*
-                                 * Elimination and expansion of conditionals;
-                                 * gcc has no direct equivalent.
-                                 */
-                                break;
-                        }
                         if (strcmp(arg, "-Wd,-xsafe=unboundsym") == 0) {
                                 /*
                                  * Prevents optimizing away checks for
                                  * unbound weak symbol addresses.  gcc does
                                  * not do this, so it's not needed.

@@ -1118,17 +1003,10 @@
                                  * gcc does not do this, so it's not needed.
                                  */
                                 break;
                         }
 #if defined(__x86)
-                        if (strcmp(arg, "-Wu,-xmodel=kernel") == 0) {
-                                newae(ctx->i_ae, "-ffreestanding");
-                                newae(ctx->i_ae, "-mno-red-zone");
-                                model = "-mcmodel=kernel";
-                                nolibc = 1;
-                                break;
-                        }
                         if (strcmp(arg, "-Wu,-save_args") == 0) {
                                 newae(ctx->i_ae, "-msave-args");
                                 break;
                         }
 #endif  /* __x86 */

@@ -1138,40 +1016,20 @@
                         if (strcmp(arg, "-Xa") == 0 ||
                             strcmp(arg, "-Xt") == 0) {
                                 Xamode(ctx->i_ae);
                                 break;
                         }
-                        if (strcmp(arg, "-Xc") == 0) {
-                                Xcmode(ctx->i_ae);
-                                break;
-                        }
                         if (strcmp(arg, "-Xs") == 0) {
                                 Xsmode(ctx->i_ae);
                                 break;
                         }
                         error(arg);
                         break;
                 case 'x':
                         if (arglen == 1)
                                 error(arg);
                         switch (arg[2]) {
-#if defined(__x86)
-                        case '3':
-                                if (strcmp(arg, "-x386") == 0) {
-                                        newae(ctx->i_ae, "-march=i386");
-                                        break;
-                                }
-                                error(arg);
-                                break;
-                        case '4':
-                                if (strcmp(arg, "-x486") == 0) {
-                                        newae(ctx->i_ae, "-march=i486");
-                                        break;
-                                }
-                                error(arg);
-                                break;
-#endif  /* __x86 */
                         case 'a':
                                 if (strncmp(arg, "-xarch=", 7) == 0) {
                                         mflag |= xlate_xtb(ctx->i_ae, arg + 7);
                                         break;
                                 }

@@ -1208,19 +1066,15 @@
                                         xlate(ctx->i_ae, arg + 7, xcode_tbl);
                                         if (strncmp(arg + 7, "pic", 3) == 0)
                                                 pic = 1;
                                         break;
                                 }
-                                if (strncmp(arg, "-xcache=", 8) == 0)
-                                        break;
                                 if (strncmp(arg, "-xcrossfile", 11) == 0)
                                         break;
                                 error(arg);
                                 break;
                         case 'd':
-                                if (strcmp(arg, "-xdepend") == 0)
-                                        break;
                                 if (strncmp(arg, "-xdebugformat=", 14) == 0)
                                         break;
                                 error(arg);
                                 break;
                         case 'F':

@@ -1253,28 +1107,10 @@
                                         break;
                                 }
                                 error(arg);
                                 break;
 #endif  /* __x86 */
-                        case 'M':
-                                if (strcmp(arg, "-xM") == 0) {
-                                        newae(ctx->i_ae, "-M");
-                                        break;
-                                }
-                                if (strcmp(arg, "-xM1") == 0) {
-                                        newae(ctx->i_ae, "-MM");
-                                        break;
-                                }
-                                error(arg);
-                                break;
-                        case 'n':
-                                if (strcmp(arg, "-xnolib") == 0) {
-                                        nolibc = 1;
-                                        break;
-                                }
-                                error(arg);
-                                break;
                         case 'O':
                                 if (strncmp(arg, "-xO", 3) == 0) {
                                         size_t len = strlen(arg);
                                         char *s = NULL;
                                         int c = *(arg + 3);

@@ -1304,21 +1140,10 @@
                                         free(s);
                                         break;
                                 }
                                 error(arg);
                                 break;
-                        case 'p':
-                                if (strcmp(arg, "-xpentium") == 0) {
-                                        newae(ctx->i_ae, "-march=pentium");
-                                        break;
-                                }
-                                if (strcmp(arg, "-xpg") == 0) {
-                                        newae(ctx->i_ae, "-pg");
-                                        break;
-                                }
-                                error(arg);
-                                break;
                         case 'r':
                                 if (strncmp(arg, "-xregs=", 7) == 0) {
                                         xlate(ctx->i_ae, arg + 7, xregs_tbl);
                                         break;
                                 }

@@ -1330,22 +1155,10 @@
                                     strcmp(arg, "-xstrconst") == 0)
                                         break;
                                 error(arg);
                                 break;
                         case 't':
-                                if (strcmp(arg, "-xtransition") == 0) {
-                                        newae(ctx->i_ae, "-Wtransition");
-                                        break;
-                                }
-                                if (strcmp(arg, "-xtrigraphs=yes") == 0) {
-                                        newae(ctx->i_ae, "-trigraphs");
-                                        break;
-                                }
-                                if (strcmp(arg, "-xtrigraphs=no") == 0) {
-                                        newae(ctx->i_ae, "-notrigraphs");
-                                        break;
-                                }
                                 if (strncmp(arg, "-xtarget=", 9) == 0) {
                                         xlate(ctx->i_ae, arg + 9, xtarget_tbl);
                                         break;
                                 }
                                 error(arg);