This code is valid C++:

#define S(a) #a
const char* s = S(and);

However, the C frontend gives a warning with -Wc++-compat:

foo.c:2:19: warning: identifier "and" is a special operator name in C++

This warning should not be given if the preprocessor token is simply
stringified.


-- 
           Summary: Invalid -Wc++-compat warning about stringized C++
                    operator name
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ian at airs dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40564

Reply via email to