From 0216c00c386a5a53503fdb97c0bc05f068477ce2 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Sun, 30 May 2010 16:55:19 +0200 Subject: 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. --- bcc/declare.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bcc') 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 */ -- cgit v1.2.1