README.Portability (Function prototypes): Give an example of declaring and defining...
authorMatt Kraai <kraai@alumni.cmu.edu>
Mon, 1 Jul 2002 20:24:41 +0000 (20:24 +0000)
committerMatt Kraai <kraai@gcc.gnu.org>
Mon, 1 Jul 2002 20:24:41 +0000 (20:24 +0000)
* README.Portability (Function prototypes): Give an example of
declaring and defining a function with no arguments.

From-SVN: r55151

gcc/ChangeLog
gcc/README.Portability

index 85775c9d8eb88fafbbd7354f3399cfd07e933085..5b1fe5e0e07236855540bd8a1ad876ea8c61ab21 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 ccd05e7521d5c1da148ef7bf18e10a6b7d4fb1ad..dba12406c61b93badeb1caa16d0f7e35d4b83df8 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.