This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48740] New: Raw C++0x strings and trigraphs mix badly
- From: "kayhayen at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 23 Apr 2011 09:16:07 +0000
- Subject: [Bug c++/48740] New: Raw C++0x strings and trigraphs mix badly
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48740
Summary: Raw C++0x strings and trigraphs mix badly
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: kayhayen@gmx.de
Created attachment 24078
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24078
One liner with constant demonstrating the error.
Hello there,
my file has just one line:
char const *R = "raw(foo%sbar%sfred%sbob?????)raw";
This is supposed to work, but gives:
g++-4.6 -c -std=c++0x -Wall -Werror something.build/__constants.cpp
something.build/__constants.cpp:2:44: error: trigraph ??) converted to ]
[-Werror=trigraphs]
cc1plus: all warnings being treated as errors
Adding a space before the closing ")" of the raw string gives me no problem at
all. I have had instances where the compiler complained about an unterminated
strings constant after shuffling raw strings around. Having multiple raw
strings in my file, separated by raw()raw each, it seems, I had the case, where
a raw constant would eat up towards the next, very unpleasant.
Question: Are trigraphs still in C++0x, are they supposed to be applied to raw
strings too? How can I disable trigraphs. I only found an option to enable it,
and a reference that -std would.
Note: I really want to use raw strings to encode arbitrary data for my Python
compiler. I truly need a way to avoid trigraphs. So please remove trigraphs
from the C++0x case, or add an option to disable them.
Yours,
Kay Hayen