delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/13/20:27:10

From: alain AT qnx DOT com (Alain Magloire)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: `void main' in Gnu packages---?!
Date: 14 Jan 2000 01:07:18 GMT
Organization: QNX Software Systems
Lines: 34
Message-ID: <85lss6$2t3$1@gateway.qnx.com>
References: <200001131712 DOT LAA06016 AT darwin DOT sfbr DOT org>
NNTP-Posting-Host: qnx.com
X-Trace: gateway.qnx.com 947812038 2979 209.226.137.1 (14 Jan 2000 01:07:18 GMT)
X-Complaints-To: usenet AT qnx DOT com
NNTP-Posting-Date: 14 Jan 2000 01:07:18 GMT
X-Newsreader: TIN [version 1.2 PL2]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Jeff Williams (jeffw AT darwin DOT sfbr DOT org) wrote:
: Why do I see something like this:

: void
: main (argc, argv)
:      int argc;
:      char **argv;

: in some GNU packages (i.e., `void main' rather than `int main')?  Is it
: for some obscure backwards compatibility? I didn't get any complaints
: about this with my djgpp/gcc setup (but is that good or bad?, but my
: Solaris box at work complains, as follows:

: time.c: In function `main':
: time.c:633: warning: return type of `main' is not `int'
: make: *** [time.o] Error 1

: Duh.  Easy to fix, but why is it `void main' in the first place?

If you find this in any GNU programs consider it as a bug and report it to
the appropriate mailing list.  bug-gnu-utils AT gnu DOT org is a good start.

I'm certainly curious to know in which program/package, since most of the
GNU *utils are design to be use with Unix shells so the return
value of main is important when doing shell scripts.

Also, I don't have my ANSI C std at hand but, I think, ANSI C and the 
new C9x require that "int main ()".


--
au revoir, alain
----
Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!

- Raw text -


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