lint (was: Funny mistake)

Michael Kahl mkahl at world.std.com
Sat Mar 30 02:12:28 AEST 1991


In article <3433 at inews.intel.com> bhoughto at pima.intel.com (Blair P. Houghton) writes:
>
>An ANSI compiler is required to compile functions
>and function calls that are declared in the old style;
>however, it is explicitly stated in the standard that
>the arguments to a function defined in old-style will
>not be _checked_, even though passing bogus-typed data
>can still produce bad results.
>
>(see ANSI X3.159-1989, sec. 3.5.4.3, p. 69, ll. 10-11
>for one version of it, and sec. 3.5.2.2, p. 42,
>ll. 17-19 for the actual words "the number and types of
>arguments are not compared with those of the parameters
>in a function definition that does not include a
>function prototype declarator.")
>

However, earlier in the section (p. 42, ll. 3-7), the Standard says
that if the number and types of the arguments do *not* agree with
those of the parameters, the behavior is undefined.  Therefore, a
conforming translator can legimitately do whatever it likes, including
reporting type mismatches and/or inserting appropriate conversions.
The Standard does not forbid a conforming implementation from being
helpful in this manner.
-- 
Michael Kahl, Symantec Corporation
mkahl at world.std.com  -or-  75236.3146 at compuserve.com
Disclaimer:  Keep this quiet; what my employer doesn't know won't get me fired.



More information about the Comp.lang.c mailing list