From: Matt Kraai Date: Mon, 1 Jul 2002 20:24:41 +0000 (+0000) Subject: README.Portability (Function prototypes): Give an example of declaring and defining... X-Git-Tag: releases/gcc-3.3.0~4014 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3b2124df5f33c5456daeee53f1c4bbab68ff6d03;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 85775c9d8eb8..5b1fe5e0e072 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 ccd05e7521d5..dba12406c61b 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.