Article View: comp.std.c
Article #1843Re: prototypes required ?
From: Christopher R Volpe
Date: Wed, 17 Oct 1990 12:36
Date: Wed, 17 Oct 1990 12:36
34 lines
2099 bytes
2099 bytes
In article <14164@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn) writes:
|>In article <4026@otis.oakhill.UUCP> jeff@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@crd.ge.com
Technical Details
Message-ID:
<12826@crdgw1.crd.ge.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!rpi!crdgw1!underdog!volpeReferences:
<4026@otis.oakhill.UUCP> <14164@smoke.BRL.MIL>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!rpi!crdgw1!underdog!volpe From: volpe@underdog.crd.ge.com (Christopher R Volpe) Newsgroups: comp.std.c Subject: Re: prototypes required ? Keywords: printf stdargs prototypes Message-ID: <12826@crdgw1.crd.ge.com> Date: 17 Oct 90 12:36:33 GMT References: <4026@otis.oakhill.UUCP> <14164@smoke.BRL.MIL> Sender: news@crdgw1.crd.ge.com Reply-To: volpe@underdog.crd.ge.com (Christopher R Volpe) Lines: 34