This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: (printf) ("hello world\n");



On Dec 9, 2003, at 12:40 PM, Michael Elizabeth Chastain wrote:


I have a language lawyer question.

  int main ()
  {
    (printf) ("hello world\n");
    return 0;
  }

Is this a conforming C program?

c89 3.3.2.2:
"If the expression that precedes the parenthesized argument list in a function call
consists solely of an identifier, and if no declaration is visible for this identifier,
the identifier is implicitly declared exactly as if , in the innermost block containing
the function call, the declaration "extern int <identifier>();" appeared."


So the implicit declaration is not supposed to happen when the function identifier
is surrounded by parentheses, and this is not conforming.



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