diff options
-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 85775c9d8eb..5b1fe5e0e07 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 ccd05e7521d..dba12406c61 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. |