aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@celest.fr>2011-02-07 23:46:20 +0100
committerThomas Preud'homme <thomas.preudhomme@celest.fr>2011-02-07 23:46:20 +0100
commitc23400278ad7a1a44cb9b469c4635ea29cb12b25 (patch)
treecbc675edde79833b80075cef1a9bac57b51215f7
parentcf36410e30b3c18be6c556158b2d0d0938f5b77d (diff)
downloadtinycc-c23400278ad7a1a44cb9b469c4635ea29cb12b25.tar.gz
tinycc-c23400278ad7a1a44cb9b469c4635ea29cb12b25.tar.bz2
Fix incorrect use of basic type as bitflags.
Fix incorrect use of basic types as bitflags and inefficiency in commit cf36410e30b3c18be6c556158b2d0d0938f5b77d
-rw-r--r--tccgen.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tccgen.c b/tccgen.c
index 8464e64..d806a38 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -5423,10 +5423,6 @@ ST_FUNC void decl(int l)
while (1) { /* iterate thru each declaration */
type = btype;
type_decl(&type, &ad, &v, TYPE_DIRECT);
- if (((type.t & (VT_STATIC|VT_FUNC)) == (VT_STATIC|VT_FUNC))
- && (l == VT_LOCAL)) {
- error("Function without file scope cannot be static");
- }
#if 0
{
char buf[500];
@@ -5435,6 +5431,9 @@ ST_FUNC void decl(int l)
}
#endif
if ((type.t & VT_BTYPE) == VT_FUNC) {
+ if ((type.t & VT_STATIC) && (l == VT_LOCAL)) {
+ error("function without file scope cannot be static");
+ }
/* if old style function prototype, we accept a
declaration list */
sym = type.ref;