]> git.sur5r.net Git - cc65/blobdiff - src/cc65/declare.c
Transfer the storage class flags from struct DeclSpec into struct Declaration.
[cc65] / src / cc65 / declare.c
index 2b4a09a42a61f2644755c169679236b067ef2b2e..441ce8f9822e09e28d3d4af410642a1339e5c1a1 100644 (file)
@@ -820,14 +820,14 @@ static void ParseAnsiParamList (FuncDesc* F)
            F->Flags |= FD_UNNAMED_PARAMS;
 
            /* Clear defined bit on nonames */
-           Spec.StorageClass &= ~SC_DEF;
+           Decl.StorageClass &= ~SC_DEF;
        }
 
        /* Parse an attribute ### */
        ParseAttribute (&Decl, &Attr);
 
        /* Create a symbol table entry */
-       AddLocalSym (Decl.Ident, ParamTypeCvt (Decl.Type), Spec.StorageClass, 0);
+       AddLocalSym (Decl.Ident, ParamTypeCvt (Decl.Type), Decl.StorageClass, 0);
 
        /* Count arguments */
                ++F->ParamCount;
@@ -1154,6 +1154,9 @@ void ParseDecl (const DeclSpec* Spec, Declaration* D, unsigned Mode)
     NeedTypeSpace (D, TypeLen (Spec->Type) + 1);       /* Bounds check */
     TypeCpy (D->Type + D->Index, Spec->Type);
 
+    /* Use the storage class from the declspec */
+    D->StorageClass = Spec->StorageClass;
+
     /* Fix any type qualifiers attached to an array type */
     FixArrayQualifiers (D->Type);