This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
RE: K&R style prototypes
- To: egcs-bugs at cygnus dot com
- Subject: RE: K&R style prototypes
- From: Jimen Ching <jching at flex dot com>
- Date: Mon, 6 Apr 1998 21:53:44 -1000 (HST)
- Reply-To: Jimen Ching <jching at flex dot com>
Thanks for all of the replies. I don't have the standard, so could
someone quote the passage that specifically allows the K&R style function
declaration? I also tried the suggestions that some had made. Here is
what I found:
[flex:ttyp2]~% gcc -Wmissing-prototypes tst_trad.c
tst_trad.c:8: warning: no previous prototype for `func'
[flex:ttyp2]~% gcc -Wstrict-prototypes tst_trad.c
tst_trad.c:8: warning: function declaration isn't a prototype
tst_trad.c:16: warning: function declaration isn't a prototype
Neither of these is what I was looking for. I'm looking for a warning or
error message that says: "K&R style prototype used with -ansi".
Btw, I'm curious. What is the benefit of the warnings above? Who cares
if there's no previous prototype for 'func'? Since I call the function
after it is defined, what would be the point of prototyping it?
--jc
--
Jimen Ching (WH6BRR) jching@flex.com wh6brr@uhm.ampr.org