Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!world!mkahl From: mkahl@world.std.com (Michael Kahl) Newsgroups: comp.lang.c Subject: Re: lint (was: Funny mistake) Message-ID: <1991Mar29.161228.15973@world.std.com> Date: 29 Mar 91 16:12:28 GMT References: <13627@helios.TAMU.EDU> <5043@goanna.cs.rmit.oz.au> <3433@inews.intel.com> Organization: The World @ Software Tool & Die Lines: 28 In article <3433@inews.intel.com> bhoughto@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@world.std.com -or- 75236.3146@compuserve.com Disclaimer: Keep this quiet; what my employer doesn't know won't get me fired.