Fix lua unused-variable warning by introducing UNUSED_ATTR.

Change-Id: If19393db123e89e58545c9e0736e6fa32fccb810
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c
index 5aadfd2..d89f48f 100644
--- a/apps/plugins/lua/rocklib.c
+++ b/apps/plugins/lua/rocklib.c
@@ -185,7 +185,7 @@
  * -----------------------------
  */
 
-#define RB_WRAP(M) static int rock_##M(lua_State *L)
+#define RB_WRAP(M) static int rock_##M(lua_State UNUSED_ATTR *L)
 #define SIMPLE_VOID_WRAPPER(func) RB_WRAP(func) { (void)L; func(); return 0; }
 
 /* Helper function for opt_viewport */
diff --git a/firmware/include/gcc_extensions.h b/firmware/include/gcc_extensions.h
index 2735d6e..390e57d 100644
--- a/firmware/include/gcc_extensions.h
+++ b/firmware/include/gcc_extensions.h
@@ -66,4 +66,11 @@
 #define USED_ATTR
 #endif
 
+#if defined(__GNUC__) && (__GNUC__ >= 3)
+#define UNUSED_ATTR __attribute__((unused))
+#else
+#define UNUSED_ATTR
+#endif
+
+
 #endif /* _GCC_EXTENSIONS_H_ */