diff options
author | Matt Kraai <kraai@alumni.cmu.edu> | 2002-07-01 20:24:41 +0000 |
---|---|---|
committer | Matt Kraai <kraai@gcc.gnu.org> | 2002-07-01 20:24:41 +0000 |
commit | 3b2124df5f33c5456daeee53f1c4bbab68ff6d03 (patch) | |
tree | 0083bc63aed01b8cbc32633fd4014680b03d4cf0 | |
parent | d3fc4dbce010ac15557fd5cac3bd3ce276a254fe (diff) | |
download | gcc-3b2124df5f33c5456daeee53f1c4bbab68ff6d03.zip gcc-3b2124df5f33c5456daeee53f1c4bbab68ff6d03.tar.gz gcc-3b2124df5f33c5456daeee53f1c4bbab68ff6d03.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/README.Portability | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 85775c9..5b1fe5e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/README.Portability b/gcc/README.Portability index ccd05e7..dba1240 100644 --- a/gcc/README.Portability +++ b/gcc/README.Portability @@ -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. |