------- Comment #1 from manu at gcc dot gnu dot org  2008-08-07 11:54 -------
Confirmed as enhancement.

To clarify how to implement this, I have some questions:

(In reply to comment #0)
> -Wc++-compat should allow bool, wchar_t, char16_t and char32_t as typedefs
> defined in system headers, while warning if they are used other than as types
> or the typedefs are defined other than in system headers.

This will require:

* a check in CPP when defining new macros. It should probably allow also to be
used as macro name if defined in system header (#define bool _Bool).

* various checks in c-parser.c or c-decl.c to check for
   a) typedefs outside system headers.
   b) Names except for types.

> -Wc++-compat should warn for asm and inline when used in a C mode where they
> are identifiers not keywords, but not in a mode when they are keywords and
> not for the __ variants in any case.

I think that not checking the __ variants is given. I don't understand what you
mean by "not in a mode when they are keywords". My understanding is that we
should warn always that they are used as names (type names, identifiers, macro
names, macro parameters) and never when they are keywords (independently of the
C mode).

> -Wc++-compat should warn for uses of the alternative representations for
> operators and punctuators such as "and", including uses as macro names (except
> when defined in system headers, because of iso646.h) and macro parameter 
> names.

Hence:

* a check in CPP when defining new macros.

* various checks in c-parser.c or c-decl.c to check for names. Any use here is
wrong. (CPP would have already replaced 'and' if it is a macro).


Am I missing something?

Cheers,

Manuel.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu dot org
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-08-07 11:54:54
               date|                            |


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

Reply via email to