unspecified return type is int AFAIK,
Dave.
On Thu, 11 May 2000, Shane Dempsey wrote:
>> Hiya Kenn,
> Point taken. It is a valid and standard alternative
> to using the kind of masks that I normally use.
> It might even be a lot tidier. I guess that I was
> talking from a windows-founded ivory tower
> where we use glorious macros for these kind
> of things.
>> I'd be very interested if anyone could test the following code
> for me using gcc.
> // ===================================
> // AFAIK this shouldn't compile but VC++ thinks this
> // is just peachy.
>> struct PreludeToFailure(
> PreludeToFailure( int stuff ) : _internalStuff( stuff ) { }
>> int _internalStuff;
> }
>> main ()
> {
>> // do some stuff here
> // ...
> return 0;
>> }
>> // ===================================
>> This compiles under VC++ event with the strict ANSI compliance
> turned on ( -Za option for the MSVC compiler )
> despite ANSI C requiring an int return type from main.
> The program crashes - no shit - but still compiles as
> the struct takes an int in the constructor.
>> Just wondering if gcc is as badly behaved. I doubt it.
>> ...shane
>>>
--
------------ David Airlie, David.Airlie at ul.ie,airlied at skynet --------
Telecommunications Research Centre, ECE Dept, University of Limerick \
http://www.csn.ul.ie/~airlied -- Telecommunications Researcher \
--- TEL: +353-61-202695 -----------------------------------------------
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!