Fix incorrect use of basic type as bitflags.
Fix incorrect use of basic types as bitflags and inefficiency in commit
cf36410e30
This commit is contained in:
parent
cf36410e30
commit
c23400278a
1 changed files with 3 additions and 4 deletions
7
tccgen.c
7
tccgen.c
|
@ -5423,10 +5423,6 @@ ST_FUNC void decl(int l)
|
||||||
while (1) { /* iterate thru each declaration */
|
while (1) { /* iterate thru each declaration */
|
||||||
type = btype;
|
type = btype;
|
||||||
type_decl(&type, &ad, &v, TYPE_DIRECT);
|
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
|
#if 0
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
@ -5435,6 +5431,9 @@ ST_FUNC void decl(int l)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if ((type.t & VT_BTYPE) == VT_FUNC) {
|
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
|
/* if old style function prototype, we accept a
|
||||||
declaration list */
|
declaration list */
|
||||||
sym = type.ref;
|
sym = type.ref;
|
||||||
|
|
Loading…
Reference in a new issue