Bug 34337 - gcc tries to interpret trigraphs in string constants
Summary: gcc tries to interpret trigraphs in string constants
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
(Show other bugs)
Version: 7.1
Hardware: i386 Linux
high
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-04-02 13:34 UTC by Nils Philippsen
Modified: 2007-03-27 03:43 UTC (History)
0 users

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


Attachments (Terms of Use)

Description Nils Philippsen 2001-04-02 13:34:11 UTC
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 14:42:44 UTC
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
printf("Eh???/n");
does the same as
printf("Eh?\n");
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.