Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.186
 
1.187
 
MAIN:plunky:20121108111403
 
cpp.c
_>7575 #define IMP(x)
 7676 #endif
 7777 
 7878 int ofd;
 7979 usch outbuf[CPPBUF], lastoch;
 8080 int obufp, istty;
<>81 -int Cflag, Mflag, dMflag, Pflag, MPflag;
  81+int Cflag, Eflag, Mflag, dMflag, Pflag, MPflag;
8282 usch *Mfile, *MPfile, *Mxfile;
 8383 struct initar *initar;
 8484 int readmac;
 8585 int defining;
<> 86+int warnings;
8687 
 8788 /* include dirs */
 8889 struct incs {
 8990         struct incs *next;
 9091         usch *dir;
 9192         dev_t dev;
     
 !
158159 #ifdef TIMING
 159160         struct timeval t1, t2;
 160161 
 161162         (void)gettimeofday(&t1, NULL);
 162163 #endif
 163164 
<>164 -        while ((ch = getopt(argc, argv, "CD:d:I:i:MPS:tU:Vvx:")) != -1) {
  165+        while ((ch = getopt(argc, argv, "CD:d:EI:i:MPS:tU:Vvx:")) != -1) {
165166                 switch (ch) {
 166167                 case 'C': /* Do not discard comments */
 167168                         Cflag++;
 168169                         break;
 169170 
<> 171+                case 'E': /* treat warnings as errors */
  172+                        Eflag++;
  173+                        break;
  174+
170175                 case 'D': /* define something */
 171176                 case 'i': /* include */
 172177                 case 'U': /* undef */
 173178                         /* XXX should not need malloc() here */
 174179                         if ((it = malloc(sizeof(struct initar))) == NULL)
 175180                                 error("couldn't apply -%c %s", ch, optarg);
     
 !
339344                 t2.tv_usec += 1000000;
 340345                 t2.tv_sec -= 1;
 341346         }
 342347         fprintf(stderr, "cpp total time: %ld s %ld us\n",
 343348              (long)t2.tv_sec, (long)t2.tv_usec);
 344349 #endif
<> 350+        if (Eflag && warnings > 0)
  351+                return 2;
  352+
345353         return 0;
 346354 }
 347355 
 348356 static void
 349357 addidir(char *idir, struct incs **ww)
 350358 {
     
 !
953961         va_start(ap, fmt);
 954962         vsheap(fmt, ap);
 955963         va_end(ap);
 956964         savch('\n');
 957965         xwrite(2, sb, stringbuf - sb);
 958966         stringbuf = sb;
<> 967+
  968+        warnings++;
<_959969 }
 960970 
 961971 void
 962972 error(const char *fmt, ...)
 963973 {
 964974         va_list ap;
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-09-23 02:23 +0200