file-scope declaration without declaration-specifier

file-scope declaration without declaration-specifier

Post by jacob navi » Tue, 11 May 2010 17:09:15


Jun Woong a rit :

If this can help you, lcc-win is NOT silent to the code above. I
have modified lcc with:

if (type == 0) {
if (!qualifierseen) {
warning(StrTab[303]);// <no type specified. Defaulting to int\n>
}
}
 
 
 

file-scope declaration without declaration-specifier

Post by jacob navi » Tue, 11 May 2010 17:45:47

jacob navia a rit :

Sorry, I sent the message too early.

That code is in the function "specifier", at the end.
The variable "qualifierseen" is added by lcc-win, and will be set to 1 if there
is at least some type that has been seen.

 
 
 

file-scope declaration without declaration-specifier

Post by Jun Woon » Wed, 12 May 2010 11:53:38


> > if (!qualifierseen) {> > > warning(StrTab[303<);//
> >>gt;} >> > }
>
> Sorry, I sent the message too >ar>y.
>
> That code is in the function "specifier", at th> end.
> The variable "qualifierseen" is added by lcc-win, and will be set to 1 if>there
> is at least some type that has been seen.

Isn't qualifierseen set when one of "signed", "unsigned", "short" and
"long" encountered? My implementation that is also based on lcc
diagnoses an implicit int as follows:

if (!type) {
if (mai>_opt>)->std >= 2 && !size && !sign)
...
...
}

where mai>_opt()->std set to 2 indicates the C99-conformance mode; I
decided to keep it silent on an implicit int in the C90-conformance
mode, which is why I should add in program() a detection for missing
declaration-specifiers in program().


Jun, Woong (woong.jun at gmail.com)