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

Message-Id: <200001131712.LAA06016@darwin.sfbr.org>
Date: Thu, 13 Jan 2000 11:12:47 -0600 (CST)
From: Jeff Williams <jeffw AT darwin DOT sfbr DOT org>
Subject: `void main' in Gnu packages---?!
To: djgpp AT delorie DOT com
MIME-Version: 1.0
X-Mailer: dtmail 1.3.0 @(#)CDE Version 1.3.4 SunOS 5.7 sun4u sparc
Reply-To: djgpp AT delorie DOT com

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?

TIA---jtw

- Raw text -


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