aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Soroka <gits@joesoroka.com>2011-03-08 01:33:17 -0800
committerJoe Soroka <gits@joesoroka.com>2011-03-08 01:33:17 -0800
commit772b302187c9d1b810f7dfe0732aef78d286e317 (patch)
tree46c6f7d11d00b615ade6efd89d88bc129296acfb
parent585027aa96360e05907669c14a0fddbf8a9de86a (diff)
downloadtinycc-772b302187c9d1b810f7dfe0732aef78d286e317.tar.gz
tinycc-772b302187c9d1b810f7dfe0732aef78d286e317.tar.bz2
added a note clarifying post_type() recursion
some ancient pre-K&R C allows a function to return an array and the array brackets to be put after the arguments, such that "int c()[]" means the same as "int[] c()" see: http://llvm.org/bugs/show_bug.cgi?id=2399 http://java.sun.com/docs/books/jls/third_edition/html/classes.html#38703
-rw-r--r--tccgen.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tccgen.c b/tccgen.c
index 32a2060..78a2bad 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -3111,6 +3111,9 @@ static void post_type(CType *type, AttributeDef *ad)
/* NOTE: const is ignored in returned type as it has a special
meaning in gcc / C++ */
type->t &= ~(VT_STORAGE | VT_CONSTANT);
+ /* some ancient pre-K&R C allows a function to return an array
+ and the array brackets to be put after the arguments, such
+ that "int c()[]" means the same as "int[] c()" */
post_type(type, ad);
/* we push a anonymous symbol which will contain the function prototype */
ad->func_args = arg_size;