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:
Matt Kraai 2002-07-01 20:24:41 +00:00 committed by Matt Kraai
parent d3fc4dbce0
commit 3b2124df5f
2 changed files with 14 additions and 0 deletions

View File

@ -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.

View File

@ -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.