Re: function prototype vs function declaration



"Ravishankar S" <ravishankar.s@xxxxxxxxxxxx> writes:
Dear C Experts,
While prepating a content for a C course,I made section on function
prototypes.
Could you kindly provide me your comments on its correctness. Thank you !

Q12: What is the difference between a function prototype and a function
declaration?
[snip]

C99 6.2.1p2:

A _function prototype_ is a declaration of a function that
declares the types of its parameters.

--
Keith Thompson (The_Other_Keith) <kst-u@xxxxxxx>
Looking for software development work in the San Diego area.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.



Relevant Pages

  • compiling ibcs on Debian 3.0 / 2.4.19 kernel and on Debian 2.2r5 / 2.2.26 kernel
    ... warning: this is the location of the previous ... declaration isn't a prototype ... incompatible pointer type ...
    (Debian-User)
  • Re: [SLE] compile problem -- WebCam
    ... > the archive and issue the make command. ... > declaration isn't a prototype ... > definition has no type or storage class ...
    (SuSE)
  • Re: General question
    ... declaration for, it assumed that it was a function returning an int ... The first true C standard, ANSI/ISO of 1989 and 1990, changed things. ... Its prototype is: ...
    (comp.lang.c)
  • Re: (part 21) Han from China answers your C questions
    ... not supplying a prototype for main. ... of a definition of that function specifies that no information about ... declared function has no parameters means this declaration does ... Syntactically, it does in fact match the K&R-style syntax rule, ...
    (comp.lang.c)
  • Re: Some Questions #2
    ... "if expr1 and expr2 are expressions, ... a byte is defined as synonymous with a char. ... A declaration describes the type of object or function ... A prototype is a description of a function's parameters. ...
    (comp.lang.c)