Xref: utzoo comp.std.c:3800 gnu.gcc.help:36 Newsgroups: comp.std.c,gnu.gcc.help Path: utzoo!telly!druid!darcy From: darcy@druid.uucp (D'Arcy J.M. Cain) Subject: Re: prototypes required ? Organization: D'Arcy Cain Consulting, West Hill, Ontario Date: Fri, 19 Oct 90 10:38:25 GMT Message-ID: <1990Oct19.103825.20204@druid.uucp> Keywords: printf stdargs prototypes References: <4026@otis.oakhill.UUCP> <14164@smoke.BRL.MIL> <1964@ccadfa.adfa.oz.au> 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. Is gcc on the Pyramid broken that badly? On my SysV 386 system: $ cat ptest.c extern int printf(const char *format, ...); int main(void) { printf("%d %s\n", 5, "Hello world"); return(0); } $ gcc -Wall -ansi ptest.c -o ptest $ ptest 5 Hello world $ -- D'Arcy J.M. Cain (darcy@druid) | D'Arcy Cain Consulting | I support gun control. West Hill, Ontario, Canada | Let's start with the government! + 416 281 6094 |