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

Jason Merrill jason@cygnus.com
Wed Dec 10 10:52:00 GMT 1997


>>>>> 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



More information about the Gcc-bugs mailing list