Procházet zdrojové kódy

[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 před 13 roky
rodič
revize
511fd46976
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2
    1
      src/include/ipxe/tables.h

+ 2
- 1
src/include/ipxe/tables.h Zobrazit soubor

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

Načítá se…
Zrušit
Uložit