Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!sdd.hp.com!uakari.primate.wisc.edu!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: prototypes required ? Keywords: printf stdargs prototypes Message-ID: <14182@smoke.BRL.MIL> Date: 18 Oct 90 16:48:04 GMT References: <4026@otis.oakhill.UUCP> <14164@smoke.BRL.MIL> <1964@ccadfa.adfa.oz.au> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 12 In article <1964@ccadfa.adfa.oz.au> Christopher-Vance@adfa.oz.au writes: >gwyn@smoke.BRL.MIL (Doug Gwyn) writes: >| Yes, you definitely must have a prototype in scope before calling a >| variable-argument function in a strictly conforming program. >Which means that gcc -ansi on a Pyramid cannot compile such a thing. I am >informed that the only way to make printf work is to *omit* the prototype. As I said before, you should rely on to properly declare printf(). If is not included at all, then the C standard guarantees that you could declare printf() directly in your program, providing that you use the prototype specified in the standard. "extern int printf();" on the other hand has undefined behavior.