Browse Source

[build] Avoid spurious unused-but-set-variable warnings in gcc 4.6

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>
tags/v1.20.1
Michael Brown 13 years ago
parent
commit
511fd46976
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/include/ipxe/tables.h

+ 2
- 1
src/include/ipxe/tables.h View File

@@ -248,7 +248,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
248 248
  */
249 249
 #define __table_entries( table, idx ) ( {				\
250 250
 	static __table_type ( table ) __table_entries[0]		\
251
-		__table_entry ( table, idx ); 				\
251
+		__table_entry ( table, idx ) 				\
252
+		__attribute__ (( unused ));				\
252 253
 	__table_entries; } )
253 254
 
254 255
 /**

Loading…
Cancel
Save