Article View: comp.std.c
Article #1869Re: prototypes required ?
From: D'Arcy J.M. Cain
Date: Fri, 19 Oct 1990 10:38
Date: Fri, 19 Oct 1990 10:38
23 lines
1301 bytes
1301 bytes
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 |
Technical Details
Message-ID:
<1990Oct19.103825.20204@druid.uucp>Path:
arc1-ca.pugleaf.net!utzoo!telly!druid!darcyReferences:
<4026@otis.oakhill.UUCP> <14164@smoke.BRL.MIL> <1964@ccadfa.adfa.oz.au>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c,gnu.gcc.help Path: arc1-ca.pugleaf.net!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>