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

Re: [MiNT] MiNTLib 0.51



Julian Reschke wrote:

> Who the hell is generating code like this? This would also fail on machines
> where a similar parameter passing scheme is used, or where sizeof (long) !=
> sizeof (void *).

And dont forget the following:

If a prototype is declared Pure C applies implicit coercions to
passed arguments.

PE:
short i;/* I suppose short is shorter than long */

p(i);	/* passed as short */

In another file, so nothing is warned:
void p(long i)	/* Could have been short once, but is for a reason changed to long */
{
use i		/* used as long, but it is not extended when called */
}

If there had been a prototype in a common headerfile and you forgot to change
that too, Pure C would have told you.

Henk.