Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 34337 - gcc tries to interpret trigraphs in string constants
gcc tries to interpret trigraphs in string constants
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
high Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-04-02 09:34 EDT by Nils Philippsen
Modified: 2007-03-26 23:43 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-04-02 09:34:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Nils Philippsen 2001-04-02 09:34:11 EDT
Trying to compile this simple program:

--- 8< --- trigraph-error.c ---
#include <stdio.h>

int main (int argc, char **argv)
	puts ("Error (???) FIXME");
	return 1;
--- >8 ------------------------

with "gcc -Wall" results in this warning:

trigraph-error.c:5:24: warning: trigraph ??) ignored

I don't think that it's correct for gcc to try to interpret trigraphs
inside string constants.
Comment 1 Jakub Jelinek 2001-04-02 10:42:44 EDT
What's so special about trigraphs in string constants?
The warning you see is not about interpreting the trigraph, it is a
portability warning (the program will give different result when compiled
with -std=c89 (or -ansi or -std=c99) than without these options.
With e.g. C99 you get a different warning:
gcc -O2 -std=c99 -o o o.c -Wall
o.c:5:18: warning: trigraph ??) converted to ]
E.g. ISO C99 standard explicitely lists as an example that
does the same as
The only place where -Wtrigraphs does not warn in is in comments.

Note You need to log in before you can comment on or make changes to this bug.