[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] PML trouble with -m68020-60



Hi,

On torstai 13 tammikuu 2011, Helmut Karlowski wrote:
> Am 13.01.2011, 21:52 Uhr, schrieb Thomas Jürges
> > On 2011-01-13 13:36, Helmut Karlowski wrote:
> >>> (fully qualified prototype) but in C "()" equals to K&R prototype
> >>> meaning
> >>> "(int)".
> >> 
> >> Meaning unknown.
> > 
> > Means that in C the omission of the parameter list like
> > 
> > void foo();
> > 
> > is automatically, according to the C-bible by Kernighan & Ritchie,
> > assumed to be
> > 
> > void (foo int);

I'm sure that I've seen the default argument thing somewhere (maybe it
was specific to some old K&R compiler), but now that I checked the actual
C spec, it indeed said that if no arguments are listed, all argument
checking is disabled (for K&R compatibility).

> Then this code should not compile:
> 
> 
> void f();			<- == void f(int);
> 
> void g(void)
> {
>    f(1,2);
> }
> 
> But it does.

All argument checking being off isn't any better from argument mismatch
catching point of view though....


	- Eero