]> git.sur5r.net Git - cc65/blobdiff - src/cc65/declattr.c
Fixed two compiler warnings.
[cc65] / src / cc65 / declattr.c
index 91c7682e214d0b6b9027429b08f8a2eef0c926e4..5110361b782e1d5822727a14977d1d5096541b93 100644 (file)
@@ -56,6 +56,7 @@
 
 /* Forwards for attribute handlers */
 static void NoReturnAttr (Declaration* D);
+static void UnusedAttr (Declaration* D);
 
 
 
@@ -67,7 +68,9 @@ struct AttrDesc {
 };
 static const AttrDesc AttrTable [] = {
     { "__noreturn__",   NoReturnAttr    },
+    { "__unused__",     UnusedAttr      },
     { "noreturn",       NoReturnAttr    },
+    { "unused",         UnusedAttr      },
 };
 
 
@@ -156,7 +159,7 @@ static void AddAttr (Declaration* D, DeclAttr* A)
 
 
 
-void NoReturnAttr (Declaration* D)
+static void NoReturnAttr (Declaration* D)
 /* Parse the "noreturn" attribute */
 {
     /* Add the noreturn attribute */
@@ -165,6 +168,15 @@ void NoReturnAttr (Declaration* D)
 
 
 
+static void UnusedAttr (Declaration* D)
+/* Parse the "unused" attribute */
+{
+    /* Add the noreturn attribute */
+    AddAttr (D, NewDeclAttr (atUnused));
+}
+
+
+
 void ParseAttribute (Declaration* D)
 /* Parse an additional __attribute__ modifier */
 {