This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

cpp oddities. was: sparc-sun-solaris2.8 headers: fixinc, cpplib


> And this should fix the syshdr issue (please let me know!).  It's not

It's a definite improvement.  We still have a serious regresson since
2.95, though and some other cpp weirdness.

$ echo '#include <sys/stat.h>' > /tmp/z.c

Before this patch:

t ./xgcc -c -Wall -B./ -I./ /tmp/z.c
In file included from /tmp/z.c:1:
include/sys/stat.h:1: warning: ignoring #pragma comment
In file included from include/sys/stat.h:1,
                 from /tmp/z.c:1:
include/sys/types.h:1: warning: ignoring #pragma comment
In file included from include/sys/types.h:352,
                 from include/sys/stat.h:1,
                 from /tmp/z.c:1:
/usr/include/sys/fdmac.h:1: warning: ignoring #pragma comment
include/sys/stat.h:246: warning: `stat' defined but not used
include/sys/stat.h:256: warning: `fstat' defined but not used
include/sys/stat.h:269: warning: `lstat' defined but not used
include/sys/stat.h:282: warning: `statlstat' defined but not used


After:

$ ./xgcc -c -Wall -B./ -I./ /tmp/z.c
include/sys/stat.h:246: warning: `stat' defined but not used
include/sys/stat.h:256: warning: `fstat' defined but not used
include/sys/stat.h:269: warning: `lstat' defined but not used
include/sys/stat.h:282: warning: `statlstat' defined but not used

So it does clean up the warnings about system pragmas.


Another mystery to me is that this behaves differently if it's manually
preprocessed vs. letting the wrapper do it.

$ ./xgcc -E -Wall -B./ -I./ /tmp/z.c > /tmp/x.i
(robertl) rjlhome:/play/negcs/gcc
$ ./xgcc -B./ -c -Wall /tmp/x.i
[ no warnings ] 

Stranger still, adding -P results in an incredibly ugly file.

$ ./xgcc -E -P -Wall -B./ -I./ /tmp/z.c  | head -20
#pragma comment(exestr, "@(#) stat.h 26.2 95/11/30 ")
#pragma comment(exestr, "@(#) types.h 26.3 95/11/30 ")
#pragma pack(4)
typedef
        long
                        daddr_t
                               ;
typedef
        char
             *
                        caddr_t
                               ;
typedef
        struct
               {
                 int
                     r
                      [
                       1
                        ]


Are these all related?   Dunno.

Thanx, Neil
RJL

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]