This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: K&R style prototypes


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]