Article View: gnu.gcc.bug
Article #2904function prototype syntax
From: Eric Hanchrow
Date: Tue, 27 Feb 1990 00:16
Date: Tue, 27 Feb 1990 00:16
32 lines
1850 bytes
1850 bytes
Here's an entire program which compiles just fine with gcc-1.37
(Sparc, SunOS 4.0.c).
extern int fred(int a, int );
I tried compiling the same program with Microsoft C 5.1, and it said
unto me, quote,
junk3.c(1) : error C2059: syntax error : ','
I promptly got on the phone to Microsoft to chew them out about this
obvious ANSI non-compatibility. The fella on the phone said, "No, the
ANSI standard requires that you either name all the arguments in a
function prototype, or none of them". Therefore, he claimed, the
error generaed by Microsoft was correct (although not very
informative).
Now, I don't have a copy of the Standard, but if the guy at Microsoft
was right, then gcc should also complain when presented with this
code.
For comparison, these programs (according to the guy from Microsoft)
are correct:
extern int fred(int a, int b); /* Both arguments are given names */
extern int fred(int , int ); /* Neither argument has a name */
Where does one get a copy of the Standard, anyway?
Thanks!!
-------------------------------------------------------------------------
|Eric Hanchrow yamada-sun!eric@nosun.west.sun.com |
|Phase III Logic, Inc. ...!{tektronix, sun}!nosun!yamada-sun!eric |
|1600 N.W. 167th Place Beaverton, OR 97006 |
|Voice: (503)-645-0313 Fax: (503)-645-0207 as of 13-Dec-89 |
-------------------------------------------------------------------------
Technical Details
Message-ID:
<9002270016.AA02978@yamada-sun.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!nosun.west.sun.com!yamada-sun!ericShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!nosun.west.sun.com!yamada-sun!eric From: yamada-sun!eric@nosun.west.sun.com (Eric Hanchrow) Newsgroups: gnu.gcc.bug Subject: function prototype syntax Message-ID: <9002270016.AA02978@yamada-sun.UUCP> Date: 27 Feb 90 00:16:33 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 32