aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai <kraai@alumni.cmu.edu>2002-07-01 20:24:41 +0000
committerMatt Kraai <kraai@gcc.gnu.org>2002-07-01 20:24:41 +0000
commit3b2124df5f33c5456daeee53f1c4bbab68ff6d03 (patch)
tree0083bc63aed01b8cbc32633fd4014680b03d4cf0
parentd3fc4dbce010ac15557fd5cac3bd3ce276a254fe (diff)
downloadgcc-3b2124df5f33c5456daeee53f1c4bbab68ff6d03.zip
gcc-3b2124df5f33c5456daeee53f1c4bbab68ff6d03.tar.gz
gcc-3b2124df5f33c5456daeee53f1c4bbab68ff6d03.tar.bz2
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
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/README.Portability11
2 files changed, 14 insertions, 0 deletions
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 <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.
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.