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]

Re: static a not of type int in a C++ programm?


>>>>> Alexandre Oliva <oliva@dcc.unicamp.br> writes:

> Peter Schmid writes:
>> t.C: In function `int main()':
>> t.C:3: warning: ANSI C++ forbids declaration `a' with no type

> C++ does not have the implicit int rule as C does.  However, g++ and
> egcs++ support this as an extension, as the C++ standard never
> mandates error messages or warning messages: it requires diagnostics
> for ill-formed programs, and a warning is a diagnostic.

And you can make it an error with -pedantic-errors.

Jason


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