This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: warning: trigraph ... ignored
- To: dl8bcu at gmx dot net
- Subject: Re: warning: trigraph ... ignored
- From: Joe Buck <jbuck at racerx dot synopsys dot com>
- Date: Tue, 13 Jun 2000 18:22:47 -0700 (PDT)
- Cc: gcc at gcc dot gnu dot org
> Hi!
> During my latest linux kernel compile I saw several of these warnings:
>
> gcc -D__KERNEL__ -I/usr/src/linux-2.4.0-test1-ac18-work/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -mno-fp-regs -ffixed-8 -mcpu=ev4 -Wa,-mev6 -DEXPORT_SYMTAB -c md.c
> In file included from /usr/src/linux-2.4.0-test1-ac18-work/include/linux/raid/md.h:35,
> from md.c:32:
> /usr/src/linux-2.4.0-test1-ac18-work/include/linux/delay.h:19:44: warning: trigraph ??/ ignored
-Wall turns on -Wtrigraphs. ANSI says trigraph processing happens even
in comments, and there are very rare cases where they could conceivably
make a difference (though not in this one). ??/ is turned into \.
Adding -Wno-trigraphs after -Wall should shut up the compiler.
Perhaps in cpplex.c, if we have a trigraph inside a comment, and the
trigraph processing doesn't alter anything a user can see, the
warning should be suppressed.
I vaguely recall a discussion of whether a trigraph can cause a comment
to close or not close, but I don't remember enough about the order of
preprocessing steps to know for sure. From an old CD2 draft I have,
it seems that for C++, the sequence
a = b; // ??/
c = d;
would comment out the line with c = d. The reason is that trigraph
processing (turning ??/ into \ ) comes before splicing of lines ending
in backslash with the next line. So we damn well better warn about this
particular case!
Preprocessor experts, please correct any bogosities in the above.