delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/28/14:44:13

Date: Sun, 28 Dec 97 21:34:51 PST
From: Noam Rotem <nrotem AT johnbryce DOT co DOT il>
Subject: Re: Filtering warnings
To: Nate Eldredge <eldredge AT ap DOT net>
Cc: djgpp AT delorie DOT com
Message-ID: <Chameleon.971228213913.nrotem@netvision.netvision>
MIME-Version: 1.0

>>When I'm using the -Wall switch, I get also the warning about 
>>main, defaulting to 'int'...

> IMHO, people who use `void main' deserve the
>warnings. Either don't do that, or ignore them.

>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'. 

My declaration was: *main()* not *void main()*. 
main() indeed defaults to int main(), but the question was how to use the 
shortcut without being warned.

---------------------------------------------
Noam Rotem
John Bryce Training Centre
Tel Aviv, Israel.
03-7535803
=============================================
1. Take upon yourself an impossible mission.
2. Accomplish the mission.
3. Go back to step 1.

It's the only sane answer to modern life.

---
28/12/97
21:34:51

- Raw text -


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