unsigned Flags = Entry->Flags;
/* Ignore typedef entries */
- if ((Flags & SC_TYPEDEF) != SC_TYPEDEF) {
+ if (!SymIsTypeDef (Entry)) {
/* Check if the symbol is one with storage, and it if it was
* defined but not used.
if (((Flags & SC_AUTO) || (Flags & SC_STATIC)) && (Flags & SC_EXTERN) == 0) {
if (SymIsDef (Entry) && !SymIsRef (Entry)) {
if (Flags & SC_PARAM) {
- Warning ("Parameter `%s' is never used", Entry->Name);
+ if (IS_Get (&WarnUnusedParam)) {
+ Warning ("Parameter `%s' is never used", Entry->Name);
+ }
} else {
- Warning ("`%s' is defined but never used", Entry->Name);
+ if (IS_Get (&WarnUnusedVar)) {
+ Warning ("`%s' is defined but never used", Entry->Name);
+ }
}
}
}
/* Undefined label */
Error ("Undefined label: `%s'", Entry->Name);
} else if (!SymIsRef (Entry)) {
- /* Defined but not used */
- Warning ("`%s' is defined but never used", Entry->Name);
+ /* Defined but not used */
+ if (IS_Get (&WarnUnusedLabel)) {
+ Warning ("`%s' is defined but never used", Entry->Name);
+ }
}
}
Entry = NewSymEntry (Name, SC_BITFIELD);
/* Set the symbol attributes. Bit-fields are always of type unsigned */
- Entry->Type = type_uint;
- Entry->V.B.Offs = Offs;
- Entry->V.B.BitOffs = BitOffs;
- Entry->V.B.Width = Width;
+ Entry->Type = type_uint;
+ Entry->V.B.Offs = Offs;
+ Entry->V.B.BitOffs = BitOffs;
+ Entry->V.B.BitWidth = Width;
/* Add the entry to the symbol table */
AddSymEntry (SymTab, Entry);