summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2010-05-30 16:55:19 +0200
committerLubomir Rintel <lkundrak@v3.sk>2013-10-29 16:30:53 +0100
commit0216c00c386a5a53503fdb97c0bc05f068477ce2 (patch)
treeaa4dd6b79f8ca24e9f330361e6bc3193528cec77
parent9df2b21f7ca1a595d1efadf7658203c750d91d96 (diff)
downloaddev86-0216c00c386a5a53503fdb97c0bc05f068477ce2.tar.gz
Allow non-matching implicit and explicit decl types
It's done in K&R c code a couple of times. Even gcc would allow this, so why worry.
-rw-r--r--bcc/declare.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/bcc/declare.c b/bcc/declare.c
index 09859c6..1f0aae2 100644
--- a/bcc/declare.c
+++ b/bcc/declare.c
@@ -636,6 +636,12 @@ PRIVATE void declfunc()
if( strcmp(funcname, "main") != 0 ) main_flag = -1;
if (gvarsymptr == NULL)
gvarsymptr = addglb(gvarname, gvartype);
+/* No ancient switch on small memory systems */
+#ifndef VERY_SMALL_MEMORY
+ else if (ancient) {}
+ /* Full declaration type different from the prior implicit
+ * one. Even gcc allows this, just comes up with a warning */
+#endif
else if (gvarsymptr->type != gvartype ||
(gvarsymptr->flags & INITIALIZED))
multidecl(gvarname); /* different type or full declare */