From 3b2124df5f33c5456daeee53f1c4bbab68ff6d03 Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Mon, 1 Jul 2002 20:24:41 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 3 +++ gcc/README.Portability | 11 +++++++++++ 2 files changed, 14 insertions(+) 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 + * 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. -- 2.7.4