Explorar el Código

[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 hace 13 años
padre
commit
511fd46976
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2
    1
      src/include/ipxe/tables.h

+ 2
- 1
src/include/ipxe/tables.h Ver fichero

@@ -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…
Cancelar
Guardar