]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Avoid spurious unused-but-set-variable warnings in gcc 4.6
authorMichael Brown <mcb30@ipxe.org>
Wed, 16 Mar 2011 17:15:25 +0000 (17:15 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 16 Mar 2011 19:31:44 +0000 (19:31 +0000)
The __table_entries() construction seems to trigger a false positive
warning in gcc 4.6 relating to variables which are set but never
used.  Add __attribute__((unused)) to inhibit this warning.

Reported-by: Ralph Giles <giles@thaumas.net>
Tested-by: Ralph Giles <giles@thaumas.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/tables.h

index 583ba51b8a37f302223bf2cee94075c2ac0d9f3e..e35ce822016e7b22ab6fc0db2be12668e09992c1 100644 (file)
@@ -248,7 +248,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
  */
 #define __table_entries( table, idx ) ( {                              \
        static __table_type ( table ) __table_entries[0]                \
-               __table_entry ( table, idx );                           \
+               __table_entry ( table, idx )                            \
+               __attribute__ (( unused ));                             \
        __table_entries; } )
 
 /**