Hello, $ echo '??-' | gcc -P -E -trigraphs -std=gnu99 -trigraphs - <stdin>:1:1: warning: trigraph ??- ignored, use -trigraphs to enable ??- $ That shouldn't happen. Apparently -trigraphs is ignored with -std=gnu99. Weird. Lukas
Confirmed, the problem is either in the C front-end (which is really the code which drives the preprocessor library) or in the C driver part: /Users/pinskia/local/libexec/gcc/powerpc-apple-darwin7.6.0/4.0.0/cc1 -E -quiet -v -P -trigraphs -trigraphs -D__DYNAMIC__ -D__APPLE_CC__=1 - -fPIC -std=gnu99 Note how -std=gnu99 is done after -trigraphs.
Subject: Re: trigraphs don't work with -std=gnu99 On Mon, 15 Nov 2004, pinskia at gcc dot gnu dot org wrote: > Confirmed, the problem is either in the C front-end (which is really the code which drives the > preprocessor library) or in the C driver part: > /Users/pinskia/local/libexec/gcc/powerpc-apple-darwin7.6.0/4.0.0/cc1 -E -quiet -v -P -trigraphs > -trigraphs -D__DYNAMIC__ -D__APPLE_CC__=1 - -fPIC -std=gnu99 > > Note how -std=gnu99 is done after -trigraphs. In that case the sorting needs to be disabled between these options just as -ansi and -std options are sorted together in specs (%{std*&ansi}, was bug 11459).
This is a regression from 3.0.x. Working on a patch.
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00173.html>.
Subject: Bug 18502 CVSROOT: /cvs/gcc Module name: gcc Changes by: jsm28@gcc.gnu.org 2005-02-02 23:01:11 Modified files: gcc : ChangeLog gcc.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg: pr18502-1.c Log message: PR c/18502 * gcc.c (cpp_unique_options): Remove %{trigraphs}. (cpp_options, cc1_options): Change %{std*&ansi} to %{std*&ansi&trigraphs}. testsuite: * gcc.dg/pr18502-1.c: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7378&r2=2.7379 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/gcc.c.diff?cvsroot=gcc&r1=1.444&r2=1.445 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4985&r2=1.4986 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr18502-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
Fixed on the mainline at least (for 4.0.0) but really should also be fixed on the other open branches too.
Subject: Bug 18502 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: jsm28@gcc.gnu.org 2005-05-01 10:33:40 Modified files: gcc : ChangeLog gcc.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg: pr11459-1.c pr18502-1.c Log message: PR c/11459 PR c/18502 * gcc.c (cpp_unique_options): Remove %{trigraphs}. (cpp_options, cc1_options): Change %{std*} %{ansi} to %{std*&ansi&trigraphs}. testsuite: * gcc.dg/pr11459-1.c, gcc.dg/pr18502-1.c: New tests. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.845&r2=2.2326.2.846 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/gcc.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.403.4.11&r2=1.403.4.12 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.382&r2=1.3389.2.383 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr11459-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.54.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr18502-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.28.1
Fixed for 3.4.4. Will not now be fixed on 3.3 branch.