Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Mar 1996 08:53:34 +0100 (MET)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        chat@FreeBSD.org
Subject:   Re: your mail
Message-ID:  <199603040753.IAA09685@uriah.heep.sax.de>
In-Reply-To: <Pine.BSF.3.91.960301113632.29704A-100000@nervosa.com> from "invalid opcode" at Mar 1, 96 11:37:24 am

next in thread | previous in thread | raw e-mail | index | archive | help
As invalid opcode wrote:

> > Can't be...  main() ain't void in C++.  Shall we discusss the virutues of
> > "void main()"???  Anybody seen the comp.lang.c T-shirts with the slash

> b: void main(), void main( void ), i use void main( void ) even in C++.

void main() is nonsense, in particular in environments that use the
return value from main.  main() is of type `int' by definition.

The behaviour of a type clash void <-> int is undefined (to the best
of my knowledge).  The behaviour of #pragma is undefined, too, and gcc
used to launch `nethack' for some time when it saw a #pragma.  This
was in full accordance with the standard. :-))

Go to comp.lang.c with your void main(), and see how you'll be
bombed. ;)

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199603040753.IAA09685>