prototypes required ?

D'Arcy J.M. Cain darcy at druid.uucp
Fri Oct 19 20:38:25 AEST 1990


In article <1964 at ccadfa.adfa.oz.au> Christopher-Vance at adfa.oz.au writes:
>gwyn at 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 at druid)     |
D'Arcy Cain Consulting             |   I support gun control.
West Hill, Ontario, Canada         |   Let's start with the government!
+ 416 281 6094                     |



More information about the Comp.std.c mailing list