]> git.sur5r.net Git - cc65/commitdiff
Merge https://github.com/cc65/cc65
authorBas Wassink <b.wassink@ziggo.nl>
Sun, 24 Mar 2019 19:49:53 +0000 (20:49 +0100)
committerBas Wassink <b.wassink@ziggo.nl>
Sun, 24 Mar 2019 19:49:53 +0000 (20:49 +0100)
Pull to fix extra changes in PR #863

1  2 
src/cc65/locals.c
src/cc65/symtab.c

diff --combined src/cc65/locals.c
index 024c1c5fc457344f559ced2e3da1964939c2b85b,d0aab7f9c639168e52e8dbdad809b62e716418a6..02155f412b8a84c916616e06e953e2d5fe6152b9
@@@ -143,7 -143,7 +143,7 @@@ static void ParseRegisterDecl (Declarat
              ** we cannot allow that here.
              */
              if (ParseInit (Sym->Type) != Size) {
-                 Error ("Cannot initialize flexible array members of storage class `register'");
+                 Error ("Cannot initialize flexible array members of storage class 'register'");
              }
  
              /* Generate code to copy this data into the variable space */
  
      /* Cannot allocate a variable of zero size */
      if (Size == 0) {
-         Error ("Variable `%s' has unknown size", Decl->Ident);
+         Error ("Variable '%s' has unknown size", Decl->Ident);
      }
  }
  
@@@ -275,9 -275,8 +275,9 @@@ static void ParseAutoDecl (Declaration
              ** We abuse the Collection somewhat by using it to store line
              ** numbers.
              */
 -            CollReplace (&CurrentFunc->LocalsBlockStack, (void *)(long)GetCurrentLine (),
 -                CollCount (&CurrentFunc->LocalsBlockStack) - 1);
 +            CollReplace (&CurrentFunc->LocalsBlockStack,
 +                    (void *)(size_t)GetCurrentLine (),
 +                    CollCount (&CurrentFunc->LocalsBlockStack) - 1);
  
          } else {
              /* Non-initialized local variable. Just keep track of
  
      /* Cannot allocate a variable of zero size */
      if (Size == 0) {
-         Error ("Variable `%s' has unknown size", Decl->Ident);
+         Error ("Variable '%s' has unknown size", Decl->Ident);
      }
  }
  
@@@ -411,7 -410,7 +411,7 @@@ static void ParseStaticDecl (Declaratio
  
      /* Cannot allocate a variable of zero size */
      if (Size == 0) {
-         Error ("Variable `%s' has unknown size", Decl->Ident);
+         Error ("Variable '%s' has unknown size", Decl->Ident);
      }
  }
  
diff --combined src/cc65/symtab.c
index bdbec55bb27cbf4fddcb87d2aaa9d5c1cf0b28b9,56196ea5a3e82b03d441b80a971ef06e75dee932..72f7f54daf193567529229517b69027e8f8310cb
@@@ -168,11 -168,11 +168,11 @@@ static void CheckSymTable (SymTable* Ta
                      !SymHasAttr (Entry, atUnused)) {
                      if (Flags & SC_PARAM) {
                          if (IS_Get (&WarnUnusedParam)) {
-                             Warning ("Parameter `%s' is never used", Entry->Name);
+                             Warning ("Parameter '%s' is never used", Entry->Name);
                          }
                      } else {
                          if (IS_Get (&WarnUnusedVar)) {
-                             Warning ("`%s' is defined but never used", Entry->Name);
+                             Warning ("'%s' is defined but never used", Entry->Name);
                          }
                      }
                  }
              if (Flags & SC_LABEL) {
                  if (!SymIsDef (Entry)) {
                      /* Undefined label */
-                     Error ("Undefined label: `%s'", Entry->Name);
+                     Error ("Undefined label: '%s'", Entry->Name);
                  } else if (!SymIsRef (Entry)) {
                      /* Defined but not used */
                      if (IS_Get (&WarnUnusedLabel)) {
-                         Warning ("`%s' is defined but never used", Entry->Name);
+                         Warning ("'%s' is defined but never used", Entry->Name);
                      }
                  }
              }
@@@ -566,10 -566,10 +566,10 @@@ SymEntry* AddStructSym (const char* Nam
          /* We do have an entry. This may be a forward, so check it. */
          if ((Entry->Flags & SC_TYPEMASK) != Type) {
              /* Existing symbol is not a struct */
-             Error ("Symbol `%s' is already different kind", Name);
+             Error ("Symbol '%s' is already different kind", Name);
          } else if (Size > 0 && Entry->V.S.Size > 0) {
              /* Both structs are definitions. */
-             Error ("Multiple definition for `%s'", Name);
+             Error ("Multiple definition for '%s'", Name);
          } else {
              /* Define the struct size if it is given */
              if (Size > 0) {
@@@ -605,7 -605,7 +605,7 @@@ SymEntry* AddBitField (const char* Name
      if (Entry) {
  
          /* We have a symbol with this name already */
-         Error ("Multiple definition for `%s'", Name);
+         Error ("Multiple definition for '%s'", Name);
  
      } else {
  
@@@ -639,9 -639,9 +639,9 @@@ SymEntry* AddConstSym (const char* Name
      SymEntry* Entry = FindSymInTable (Tab, Name, HashStr (Name));
      if (Entry) {
          if ((Entry->Flags & SC_CONST) != SC_CONST) {
-             Error ("Symbol `%s' is already different kind", Name);
+             Error ("Symbol '%s' is already different kind", Name);
          } else {
-             Error ("Multiple definition for `%s'", Name);
+             Error ("Multiple definition for '%s'", Name);
          }
          return Entry;
      }
@@@ -671,7 -671,7 +671,7 @@@ DefOrRef* AddDefOrRef (SymEntry* E, uns
      DOR = xmalloc (sizeof (DefOrRef));
      CollAppend (E->V.L.DefsOrRefs, DOR);
      DOR->Line = GetCurrentLine ();
 -    DOR->LocalsBlockId = (long)CollLast (&CurrentFunc->LocalsBlockStack);
 +    DOR->LocalsBlockId = (ssize_t)CollLast (&CurrentFunc->LocalsBlockStack);
      DOR->Flags = Flags;
      DOR->StackPtr = StackPtr;
      DOR->Depth = CollCount (&CurrentFunc->LocalsBlockStack);
@@@ -706,7 -706,7 +706,7 @@@ SymEntry* AddLabelSym (const char* Name
  
          if (SymIsDef (Entry) && (Flags & SC_DEF) != 0) {
              /* Trying to define the label more than once */
-             Error ("Label `%s' is defined more than once", Name);
+             Error ("Label '%s' is defined more than once", Name);
          }
  
          NewDOR = AddDefOrRef (Entry, Flags);
                  /* Are we jumping into a block with initalization of an object that
                  ** has automatic storage duration? Let's emit a warning.
                  */
 -                if ((long)CollLast (AIC) != DOR->LocalsBlockId &&
 +                if ((size_t)CollLast (AIC) != (size_t)(DOR->LocalsBlockId) &&
                      (CollCount (AIC) < DOR->Depth ||
 -                    (long)CollAt (AIC, DOR->Depth - 1) != DOR->LocalsBlockId)) {
 +                    (size_t)CollAt (AIC, DOR->Depth - 1) != DOR->LocalsBlockId)) {
                      Warning ("Goto at line %d to label %s jumps into a block with "
                      "initialization of an object that has automatic storage duration",
                      GetCurrentLine (), Name);
                  /* Are we jumping into a block with initalization of an object that
                  ** has automatic storage duration? Let's emit a warning.
                  */
 -                if ((long)CollLast (AIC) != DOR->LocalsBlockId &&
 +                if ((ssize_t)CollLast (AIC) != DOR->LocalsBlockId &&
                      (CollCount (AIC) >= DOR->Depth ||
 -                    (long)CollLast (AIC) >= (long)DOR->Line))
 +                    (ssize_t)CollLast (AIC) >= (long)DOR->Line))
                      Warning ("Goto at line %d to label %s jumps into a block with "
                      "initialization of an object that has automatic storage duration",
                      DOR->Line, Name);
@@@ -809,7 -809,7 +809,7 @@@ SymEntry* AddLocalSym (const char* Name
      if (Entry) {
  
          /* We have a symbol with this name already */
-         Error ("Multiple definition for `%s'", Name);
+         Error ("Multiple definition for '%s'", Name);
  
      } else {
  
@@@ -865,12 -865,12 +865,12 @@@ SymEntry* AddGlobalSym (const char* Nam
          ** then avoid a compiler crash.  See GitHub issue #728.
          */
          if (Entry->Flags & SC_ENUM) {
-             Fatal ("Can't redeclare enum constant `%s' as global variable", Name);
+             Fatal ("Can't redeclare enum constant '%s' as global variable", Name);
          }
  
          /* We have a symbol with this name already */
          if (Entry->Flags & SC_TYPE) {
-             Error ("Multiple definition for `%s'", Name);
+             Error ("Multiple definition for '%s'", Name);
              return Entry;
          }
  
              if ((Size != UNSPECIFIED && ESize != UNSPECIFIED && Size != ESize) ||
                  TypeCmp (T + 1, EType + 1) < TC_EQUAL) {
                  /* Types not identical: Conflicting types */
-                 Error ("Conflicting types for `%s'", Name);
+                 Error ("Conflicting types for '%s'", Name);
                  return Entry;
              } else {
                  /* Check if we have a size in the existing definition */
          } else {
              /* New type must be identical */
              if (TypeCmp (EType, T) < TC_EQUAL) {
-                 Error ("Conflicting types for `%s'", Name);
+                 Error ("Conflicting types for '%s'", Name);
                  return Entry;
              }
  
          ** warn about the conflict.  (It will compile a public declaration.)
          */
          if ((Flags & SC_EXTERN) == 0 && (Entry->Flags & SC_EXTERN) != 0) {
-             Warning ("static declaration follows non-static declaration of `%s'.", Name);
+             Warning ("static declaration follows non-static declaration of '%s'.", Name);
          }
  
          /* An extern declaration must not change the current linkage. */
          ** warn about the conflict.  (It will compile a public declaration.)
          */
          if ((Flags & SC_EXTERN) != 0 && (Entry->Flags & SC_EXTERN) == 0) {
-             Warning ("public declaration follows static declaration of `%s'.", Name);
+             Warning ("public declaration follows static declaration of '%s'.", Name);
          }
  
          /* Add the new flags */
@@@ -1017,7 -1017,7 +1017,7 @@@ void MakeZPSym (const char* Name
      if (Entry) {
          Entry->Flags |= SC_ZEROPAGE;
      } else {
-         Error ("Undefined symbol: `%s'", Name);
+         Error ("Undefined symbol: '%s'", Name);
      }
  }