🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Wayne Stewart Mon, 08 Jan 1996 00:00
pedantic problem
#6192
Author: Wayne Stewart
Date: Mon, 08 Jan 1996 00:00
60 lines
2049 bytes
Hi,

Hopefully, all the critical info about my problem appears in the
following script:

$ uname -a
SunOS frostfire 4.1.3_U1 2 sun4m
$ ./xgcc -B./ -v
Reading specs from ./specs
gcc version 2.7.2
$ cat foobar.c

#define __USE_FIXED_PROTOTYPES__

#include <stdio.h>

#ifdef FOOBAR
__asm__("
dummy:
        nop
");
#endif

int main() {
    printf ("Hello, World!\n");
    exit(0);
}
$ ./xgcc -B./ -c -ansi -Wall foobar.c
$ ./xgcc -B./ -c -ansi -Wall -DFOOBAR foobar.c
$ ./xgcc -B./ -c -ansi -Wall -pedantic foobar.c
foobar.c:7: unterminated string or character constant
foobar.c:10: unterminated string or character constant
$ echo $status
1
$ ./xgcc -B./ -c -ansi -Wall -pedantic -DFOOBAR foobar.c
foobar.c:7: warning: string constant runs past end of line
foobar.c:7: warning: ANSI C forbids newline in string constant
foobar.c:8: warning: ANSI C forbids newline in string constant
foobar.c:9: warning: ANSI C forbids newline in string constant
$ echo $status
0
$ 

My questions are:

1) Is this a bug?  In other words, why is cpp looking at the stuff
between #ifdef FOOBAR/#endif when FOOBAR isn't defined?

2) With -pedantic, why do I get fatal errors when FOOBAR isn't
defined, but non-fatal warnings when FOOBAR is defined?  The cpp
documentation says that -pedantic will produce additional warnings,
whereas -pedantic-errors produces fatal errors.  (These 2 'pedantic'
flags behave identically in this case, i.e. fatal errors.)

3) Is there a way to pass -pedantic (or -Wall for that matter) thru
to the compiler proper (cc1) without having cpp see it?

Thanks,
    Wayne Stewart
    wstewa@atl.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads