Thread View: gnu.gcc.bug
3 messages
3 total messages
Started by Greg Hudson
Sat, 30 Nov 1996 00:00
Feature request: warn on "void main"
Author: Greg Hudson
Date: Sat, 30 Nov 1996 00:00
Date: Sat, 30 Nov 1996 00:00
19 lines
1026 bytes
1026 bytes
I've recently observed some free software authors use the
justification "it shuts up gcc" when asked why they declare main() as
void. (Presumably, they're using -Wall). Since "void main" is not
correct according to ANSI, I would appreciate it if the next version
of gcc could warn about it. I would advocate warning about it in all
cases, but warning about it only when -Wall is set is fine.
/* test1.c: warns if compiled with -Wall */
int main()
{
}
/* test2.c: does not warn even if compiled with -Wall */
void main()
{
}
Thanks.
Re: Feature request: warn on "void main"
Author: Steven Michael ROBBINS
Date: Sun, 01 Dec 1996 00:00
Date: Sun, 01 Dec 1996 00:00
12 lines
1203 bytes
1203 bytes
In article <199612010425.XAA09048@cutter-john.mit.edu>, Greg Hudson <ghudson@mit.edu> wrote: > I've recently observed some free software authors use the > justification "it shuts up gcc" when asked why they declare main() as > void. (Presumably, they're using -Wall). Since "void main" is not > correct according to ANSI, I would appreciate it if the next version > of gcc could warn about it. I would advocate warning about it in all > cases, but warning about it only when -Wall is set is fine. I second this. And it's not just fee software authors that do this; I've seen it in commercial software.
Re: Feature request: warn on "void main"
Author: Robert Dick
Date: Thu, 05 Dec 1996 00:00
Date: Thu, 05 Dec 1996 00:00
10 lines
952 bytes
952 bytes
In article <x7viahrdc0.fsf@hexadecimal.uoregon.edu> stevev@hexadecimal.uoregon.edu (Steve VanDevender) writes: >void main() isn't bad other than it returns an unknown status value to >exit(); if the program in question isn't depended on to return a >meaningful exit status then there is no problem. No. Check out the ANSI-C FAQ at rtfm.mit.edu. -Robert Dick (dickrp@wckn.dorm.clarkson.edu)-
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads