This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/48740] New: Raw C++0x strings and trigraphs mix badly


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]