using floats in functional prototypes

Guy Harris guy at auspex.UUCP
Sat Feb 4 10:07:14 AEST 1989


 >>I see no reason to make such an exception.  If you've got prototypes, use
 >>them for both declarations and defintions, whether or not the function takes a
 >>positive number of arguments.  In particular,
 >>	int main(void) { return 0; }
 >>is perfectly correct.  The old style (without `void') is obsolescent.
 >
 >Well I don't know what the dpANS says about this,...

The dpANS most definitely says that

	int foo(void) { return 0; }

is perfectly correct.

It doesn't come right out and say that the old style (without `void') is
obsolescent; however, the May 13, 1988 draft says that an implementation
may generate a warning if "a function is called but no prototype has
been specified".  This sounds to me as if they don't think that
old-style definitions are the Right Way To Go; it sounds as if they
think they're kept around for backwards compatibility and should not be
used in new code. 

>Maybe its a bug in QuickC,

It most definitely *is* a bug in QuickC if it can't cope with

	int
	foo(void)
	{
		...
	}

and it purports to match some draft of the pANS.  If it doesn't purport
to match any draft of the pANS, it's simply a horrible misfeature.



More information about the Comp.lang.c mailing list