Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.104
 
1.105
 
MAIN:ragge:20080622103541
 
cc.c
_>214214 #define STARTLABEL "__start"
 215215 #endif
 216216 
<> 217+/* handle gcc warning emulations */
  218+struct Wflags {
  219+        char *name;
  220+        int flags;
  221+#define INWALL          1
  222+#define NEGATIVE        2
  223+} Wflags[] = {
  224+        { "-Werror", 0 },
  225+        { "-Wshadow", 0 },
  226+        { "-Wno-shadow", NEGATIVE },
  227+        { "-Wno-pointer-sign", NEGATIVE },
  228+        { "-Wsign-compare", 0 },
  229+        { "-Wno-sign-compare", NEGATIVE },
  230+        { "-Wunknown-pragmas", INWALL },
  231+        { "-Wno-unknown-pragmas", NEGATIVE },
  232+        { "-Wunreachable-code", 0 },
  233+        { "-Wno-unreachable-code", NEGATIVE },
  234+        { 0, 0 },
  235+};
  236+
  237+#define SZWFL   (sizeof(Wflags)/sizeof(Wflags[0]))
  238+
217239 int
 218240 main(int argc, char *argv[])
 219241 {
<> 242+        struct Wflags *Wf;
220243         char *t, *u;
 221244         char *assource;
 222245         char **pv, *ptemp[MAXOPT], **pvt;
     
 !
256279                                         /* preprocessor */
 257280                                         if (!strncmp(argv[i], "-Wp,-C", 6))
 258281                                                 Cflag++;
<>259 -                                } else if (strcmp(argv[i], "-Werror") == 0) {
 260 -                                        wlist[nw++] = argv[i];
 261 -                                } else if (strcmp(argv[i], "-Wshadow") == 0) {
 262 -                                        wlist[nw++] = argv[i];
 263 -                                } else if (strcmp(argv[i], "-Wno-shadow") == 0) {
 264 -                                        wlist[nw++] = argv[i];
265282                                 } else if (strcmp(argv[i], "-Wall") == 0) {
<>266 -                                        wlist[nw++] = "-WW";
 267 -                                } else if (strcmp(argv[i],
 268 -                                    "-Wno-pointer-sign") == 0) {
 269 -                                        wlist[nw++] = argv[i];
 270 -                                } else if (strcmp(argv[i],
 271 -                                    "-Wsign-compare") == 0) {
 272 -                                        wlist[nw++] = argv[i];
 273 -                                } else if (strcmp(argv[i],
 274 -                                    "-Wno-sign-compare") == 0) {
 275 -                                        wlist[nw++] = argv[i];
 276 -                                } else if (strcmp(argv[i],
 277 -                                    "-Wunknown-pragmas") == 0) {
 278 -                                        wlist[nw++] = argv[i];
 279 -                                } else if (strcmp(argv[i],
 280 -                                    "-Wno-unknown-pragmas") == 0) {
 281 -                                        wlist[nw++] = argv[i];
 282 -                                } else if (strcmp(argv[i],
 283 -                                    "-Wunreachable-code") == 0) {
 284 -                                        wlist[nw++] = argv[i];
 285 -                                } else if (strcmp(argv[i],
 286 -                                    "-Wno-unreachable-code") == 0) {
 287 -                                        wlist[nw++] = argv[i];
  283+                                        /* Set only the same flags as gcc */
  284+                                        for (Wf = Wflags; Wf->name; Wf++) {
  285+                                                if (Wf->flags != INWALL)
  286+                                                        continue;
  287+                                                wlist[nw++] = Wf->name;
  288+                                        }
  289+                                } else if (strcmp(argv[i], "-WW") == 0) {
  290+                                        /* set all positive flags */
  291+                                        for (Wf = Wflags; Wf->name; Wf++) {
  292+                                                if (Wf->flags == NEGATIVE)
  293+                                                        continue;
  294+                                                wlist[nw++] = Wf->name;
  295+                                        }
  296+                                } else {
  297+                                        /* check and set if available */
  298+                                        for (Wf = Wflags; Wf->name; Wf++) {
  299+                                                if (strcmp(argv[i], Wf->name))
  300+                                                        continue;
  301+                                                wlist[nw++] = Wf->name;
  302+                                        }
<_288303                                 }
 289304                                 break;
 290305 
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-10-02 08:29 +0200