Article View: comp.std.c
Article #250declaration query
From: Anthony Scian
Date: Mon, 19 Jun 1989 16:59
Date: Mon, 19 Jun 1989 16:59
27 lines
1153 bytes
1153 bytes
This question arose from comp.lang.c:
Is this legal (ANSI)?
int foo( int, int y ) { ... } (1)
I think this should be legal:
int foo( int, int y );
and combined with this:
int foo( int x, int ) {return(x+y);}
COULD be equivalent to:
int foo( int x, int y ) {return(x+y);}
The grammar allows this but it is not clear to me what (1) means
in isolation.
Can identifiers in prototypes be different than the identifiers
in the function definition?
What about?
int test( int, int z );
int test( int x, int y ) {return(x+y);}
Should the compiler keep the identifiers and override them when
the function is defined (declared)?
//// Anthony Scian afscian@violet.uwaterloo.ca afscian@violet.waterloo.edu ////
"I can't believe the news today, I can't close my eyes and make it go away" -U2
Technical Details
Message-ID:
<14587@watdragon.waterloo.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!att!watmath!watdragon!violet!afscianShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!att!watmath!watdragon!violet!afscian From: afscian@violet.waterloo.edu (Anthony Scian) Newsgroups: comp.std.c Subject: declaration query Message-ID: <14587@watdragon.waterloo.edu> Date: 19 Jun 89 16:59:44 GMT Sender: daemon@watdragon.waterloo.edu Distribution: comp Lines: 27