prototypes required ?
Christopher R Volpe
volpe at underdog.crd.ge.com
Wed Oct 17 22:36:33 AEST 1990
In article <14164 at smoke.BRL.MIL>, gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
|>In article <4026 at otis.oakhill.UUCP> jeff at oakhill.UUCP (Jeff Enderwick)
writes:
|>>Is it legal for a compilation system to require prototypes when stdarg
|>>functions are used ? It valid for the compiler to require you to include
|>>the prototype:
|>> int printf ( const char*, ... );
|>>before making the call:
|>> printf ( "hello %d worlds\n", 5 );
|>
|>Yes, you definitely must have a prototype in scope before calling a
|>variable-argument function in a strictly conforming program.
Two questions:
1) Can you point me to a reference in the standard that says that
old-style declarations are insufficient for a variable argument
function in a strictly conforming program? Or are old style declarations
insufficient for ANY kind of function in a strictly conforming
program?
2) Are you sure you answered the question he asked? Jeff asked if
it is valid for the compiler to REQUIRE YOU TO include the
prototype. To me, "require you to" means "refuse to generate
code unless you...". That's a different issue. Unless a program
violates a syntax rule or a semantic constraint, the compiler
can at most issue a warning but must still generate code. I
believe (please correct me if I'm wrong) that a program can
fail to be strictly conforming (and even fail to be conforming)
without violating any semantic constraints. Is this correct?
==================
Chris Volpe
G.E. Corporate R&D
volpecr at crd.ge.com
More information about the Comp.std.c
mailing list