]> git.sur5r.net Git - cc65/blobdiff - src/cc65/symtab.c
Fixed problem with last change. Wide string constants were not handled
[cc65] / src / cc65 / symtab.c
index dc246ef4b87f52d7b48c612490f0903cfea581a7..5a7c740d3316169b4cb2cc491e6d80f0ae30b180 100644 (file)
@@ -162,7 +162,8 @@ static void CheckSymTable (SymTable* Tab)
             * defined but not used.
             */
            if (((Flags & SC_AUTO) || (Flags & SC_STATIC)) && (Flags & SC_EXTERN) == 0) {
-               if (SymIsDef (Entry) && !SymIsRef (Entry)) {
+               if (SymIsDef (Entry) && !SymIsRef (Entry) && 
+                    !SymHasAttr (Entry, atUnused)) {
                    if (Flags & SC_PARAM) {
                         if (IS_Get (&WarnUnusedParam)) {
                            Warning ("Parameter `%s' is never used", Entry->Name);
@@ -181,7 +182,7 @@ static void CheckSymTable (SymTable* Tab)
                    /* Undefined label */
                    Error ("Undefined label: `%s'", Entry->Name);
                } else if (!SymIsRef (Entry)) {
-                   /* Defined but not used */ 
+                   /* Defined but not used */
                     if (IS_Get (&WarnUnusedLabel)) {
                        Warning ("`%s' is defined but never used", Entry->Name);
                     }
@@ -768,7 +769,7 @@ SymEntry* AddGlobalSym (const char* Name, const Type* T, unsigned Flags)
                TypeCmp (T + 1, EType + 1) < TC_EQUAL) {
                /* Types not identical: Conflicting types */
                Error ("Conflicting types for `%s'", Name);
-               return Entry;
+               return Entry;
            } else {
                /* Check if we have a size in the existing definition */
                if (ESize == UNSPECIFIED) {
@@ -781,7 +782,7 @@ SymEntry* AddGlobalSym (const char* Name, const Type* T, unsigned Flags)
            /* New type must be identical */
            if (TypeCmp (EType, T) < TC_EQUAL) {
                Error ("Conflicting types for `%s'", Name);
-               return Entry;
+               return Entry;
            }
 
            /* In case of a function, use the new type descriptor, since it
@@ -791,9 +792,9 @@ SymEntry* AddGlobalSym (const char* Name, const Type* T, unsigned Flags)
              * empty parameter list.
             */
            if (IsFunc) {
-               /* Get the function descriptor from the new type */
-               FuncDesc* F = GetFuncDesc (T);
-               /* Use this new function descriptor if it doesn't contain
+               /* Get the function descriptor from the new type */
+               FuncDesc* F = GetFuncDesc (T);
+               /* Use this new function descriptor if it doesn't contain
                  * an empty parameter list.
                  */
                 if ((F->Flags & FD_EMPTY) == 0) {