VAX C Doesn't care about prototypes.

Walter Murray walter at hpcllca.HP.COM
Tue Jul 24 02:48:00 AEST 1990


Karl Heuer writs:

> In article <1990Jul20.184748.4362 at lotus.com> blambert at lotus.UUCP (Brian Lambert) writes:
>>void x(B *b);
>>    A a;
>>    x(&a); /* does not generate a warning */

> File a bug report.  The arguments are *not* assignment compatible.

> "3.3.4 Conversions that involve pointers (other than as permitted by the
> constraints of 3.3.16.1) shall be specified by means of an explicit cast."

> I think this should have been under Constraints rather than Semantics; as it
> stands, the diagnostic appears to be optional.  

I don't think the diagnostic is optional.  The code above violates this
CONSTRAINT from 3.3.2.2:  "Each argument shall have a type such that its
value may be assigned to an object with the unqualified version of the
type of its corresponding parameter."

It's a moot point, of course, if the compiler doesn't claim to conform
to the standard.

Walter Murray
----------



More information about the Comp.lang.c mailing list