delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/28/04:46:41

Date: Sun, 28 Dec 1997 11:45:08 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Nate Eldredge <eldredge AT ap DOT net>
cc: Noam Rotem <nrotem AT johnbryce DOT co DOT il>, djgpp AT delorie DOT com
Subject: Re: Filtering warnings
In-Reply-To: <199712261952.LAA12174@adit.ap.net>
Message-ID: <Pine.SUN.3.91.971228114448.25311N-100000@is>
MIME-Version: 1.0

On Fri, 26 Dec 1997, Nate Eldredge wrote:

> At 01:31  12/26/1997 PST, Noam Rotem wrote:
>
> >When I'm using the -Wall switch, I get also the warning about 
> >main, defaulting to 'int'...
> 
> Strangely, I can't get the warnings myself. Compiling this program:
> 
> #include <stdio.h>
> void main(void) { printf("Hello, world"); }
> 
> yields no warnings, even with `-Wall' and/or `-W'.

The warning is issued when you say "main(void)", not "void main(void)".
The latter is perfectly legal, even though it's looking for trouble
and against ANSI C rules.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019