This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: c++ language question
>>>>> "Eric" == Eric Christopher <echristo@cygnus.com> writes:
>> Does this actually buy us much? (I.e., were there conforming
>> programs that didn't work before, but will work now?)
Eric> Well.. it'll at least stop programs like:
Eric> #include <stdlib.h> int main (void) { int wchar_t = 1; }
Eric> from working.
>> I'm afraid that will simply screw up people who have typedef's
>> for wchar_t in their header files, without helping them much.
>> Jason?
Eric> It depends on what the policy is for conformance really.
Eric> Ultimately we need to make the compiler conform to the
Eric> standard, but there's room for flexibility.
My goal has always been to make the compiler conform to the standard,
but still DTRT with a pedwarn on ill-formed code (if reasonable).
This is particularly important in system header files, where the
pedwarn should be omitted.
This is why the __wchar_t hack was implemented in the first place;
many system headers had
typedef int wchar_t;
which breaks badly if wchar_t is a keyword. On the other hand, we
chose to solve the related problem for bool using fixincludes; that
may well be adequate for wchar_t as well.
If we don't go with your patch, we will need to extend the current
code to check for redeclaration of wchar_t to consider declarations in
other scopes as well.
So go ahead: put in the patch and see what breaks.
Jason