[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: g++ flag?
From: |
Hendrik Belitz |
Subject: |
Re: g++ flag? |
Date: |
Fri, 14 May 2004 08:48:35 +0200 |
User-agent: |
KNode/0.7.7 |
Default User wrote:
> Abhisek Sinha wrote:
>
>> Earlier compilers used to take the default return type of any function
>> to be int.
>> g++, in this case where ther is no return type specified gives error
>> as
>> error: ISO C++ forbids declaration of `main' with no type
>
> That is correct, it's illegal.
>
>> can this be disabled using any g++ flag in 3.3.3
This is for backward compability and the compilation of legacy code, I
think.
>> It is to be noted that gcc(3.3.2) does not throw any any error even if
>> there is no return type.
>> Not even with -ansi and -pedantic flag
That's only true if you activate the flag. Regarding my experience, the gcc
3.3.x is very rigourous in reporting such things, especially when using
-ansi and/or -pedantic.
> gcc is a C compiler and not a C++ compiler.
Well, that's wrong, since gcc is the Gnu Compiler Collection, which
supports C, C++, Java and many more...
--
To get my real email adress, remove the two onkas
--
Dipl.-Inform. Hendrik Belitz
Central Institute of Electronics
Research Center Juelich