mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-08 07:46:52 +08:00
README.Portability (Function prototypes): Give an example of declaring and defining a function with no arguments.
* README.Portability (Function prototypes): Give an example of declaring and defining a function with no arguments. From-SVN: r55151
This commit is contained in:
parent
d3fc4dbce0
commit
3b2124df5f
@ -1,5 +1,8 @@
|
||||
2002-07-01 Matt Kraai <kraai@alumni.cmu.edu>
|
||||
|
||||
* README.Portability (Function prototypes): Give an example of
|
||||
declaring and defining a function with no arguments.
|
||||
|
||||
* README.Portability (Function prototypes): Document new
|
||||
variable-argument function macros.
|
||||
|
||||
|
@ -129,6 +129,17 @@ myfunc (var1, var2)
|
||||
...
|
||||
}
|
||||
|
||||
This implies that if the function takes no arguments, it should be
|
||||
declared and defined as follows:
|
||||
|
||||
int myfunc PARAMS ((void))
|
||||
|
||||
int
|
||||
myfunc ()
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
You also need to use PARAMS when referring to function protypes in
|
||||
other circumstances, for example see "Calling functions through
|
||||
pointers to functions" below.
|
||||
|
Loading…
Reference in New Issue
Block a user