🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #6107

Feature request: warn on "void main"

#6107
From: Greg Hudson
Date: Sat, 30 Nov 1996 00:00
19 lines
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.
Technical Details
Message-ID: <199612010425.XAA09048@cutter-john.mit.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113d02,da03ab9b7be97761,start
X-Google-Attributes: gid113d02,public
From: ghudson@mit.edu (Greg Hudson)
Subject: Feature request: warn on "void main"
Date: 1996/11/30
Message-ID: <199612010425.XAA09048@cutter-john.mit.edu>
X-Deja-AN: 201671173
sender: bug-gcc-request@prep.ai.mit.edu
x-gateway: relay4.UU.NET from bug-gcc to gnu.gcc.bug; Sun, 1 Dec 1996 00:01:48 EST
newsgroups: gnu.gcc.bug