* README.Portability (Function prototypes): Give an example of
authorkraai <kraai@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Jul 2002 20:24:41 +0000 (20:24 +0000)
committerkraai <kraai@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Jul 2002 20:24:41 +0000 (20:24 +0000)
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

gcc/ChangeLog
gcc/README.Portability

index 85775c9..5b1fe5e 100644 (file)
@@ -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.
 
index ccd05e7..dba1240 100644 (file)
@@ -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.