Commit 3b2124df by Matt Kraai Committed by Matt Kraai

README.Portability (Function prototypes): Give an example of declaring and…

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
parent d3fc4dbc
2002-07-01 Matt Kraai <kraai@alumni.cmu.edu> 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 * README.Portability (Function prototypes): Document new
variable-argument function macros. variable-argument function macros.
......
...@@ -129,6 +129,17 @@ myfunc (var1, var2) ...@@ -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 You also need to use PARAMS when referring to function protypes in
other circumstances, for example see "Calling functions through other circumstances, for example see "Calling functions through
pointers to functions" below. pointers to functions" below.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment