]> git.sur5r.net Git - cc65/blobdiff - src/cc65/symtab.c
Changed names of the pragmas to be identical to the corresponding command line
[cc65] / src / cc65 / symtab.c
index c3ca6ba9406c07ce2230d400d38f3f088d400c07..dc246ef4b87f52d7b48c612490f0903cfea581a7 100644 (file)
@@ -156,7 +156,7 @@ static void CheckSymTable (SymTable* Tab)
        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.
@@ -164,9 +164,13 @@ static void CheckSymTable (SymTable* Tab)
            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);
+                        }
                    }
                }
            }
@@ -177,8 +181,10 @@ static void CheckSymTable (SymTable* Tab)
                    /* 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);
+                    }
                }
            }
 
@@ -593,10 +599,10 @@ SymEntry* AddBitField (const char* Name, unsigned Offs, unsigned BitOffs, unsign
        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);