Mail Archives: djgpp/2000/01/13/20:27:10
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 -