From: kraai Date: Mon, 1 Jul 2002 20:24:41 +0000 (+0000) Subject: * README.Portability (Function prototypes): Give an example of X-Git-Tag: upstream/4.9.2~85625 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=82808dd33bc3e8d178e35ff879a5abba9c842896;p=platform%2Fupstream%2Flinaro-gcc.git * README.Portability (Function prototypes): Give an example of declaring and defining a function with no arguments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55151 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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.