This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
gcc warning
- To: help-gcc at gnu dot org
- Subject: gcc warning
- From: Joaquin Ferruz Melero <ferruz at cartuja dot us dot es>
- Date: Mon, 2 Oct 2000 11:55:57 GMT
- Cc: ferruz at cartuja dot us dot es
Hello,
I have access to two versions of gcc: 2.7.2.3 (for Solaris) and 2.95.2
(for PC system, through mingw32). For a program such as:
void main(void)
{
printf("Hello world\n");
}
2.7.2.3 version will not give any warning, while 2.95.2 will complain
that "main" does not return an "int", as it should. The warning will
disappear either by removing "void" or replacing it by "int".
Does anyone know why they behave differently? Is there any standard that
forces "main" to return an "int", even when its return value is not
normally used?
Best regards,
Joaquin Ferruz