This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: about main must return "int"
- From: LLeweLLyn Reese <llewelly at lifesupport dot shutdown dot com>
- To: Amy Lin <alin at itsc dot uah dot edu>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 07 Jul 2003 13:09:41 -0700
- Subject: Re: about main must return "int"
- References: <3F09CFAD.8020009@itsc.uah.edu>
Amy Lin <alin@itsc.uah.edu> writes:
> Hi, I am new with this list, and I need your help.
>
> After installing Redhat 8.0 which has gcc 3.2, I ran into a problem
> when recompiling a project. with c++. It errors out on "main" must
> return "int". All my old codes with "void" main. I used c++ from
> egcs-1.1-2
The C++ standard does not allow main to return anything other than
int. gcc aims for (but not does not yet achieve) full conformance.
> (redhat 7.3) and it was no problem there. My question is: Is this a
> bug of gcc 3.2, or this is a permanent change and I will have to
> change my codes?
You will have to change your code. 'void main' was never portable
anyway.