Преглед на файлове

[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 преди 14 години
родител
ревизия
511fd46976
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2
    1
      src/include/ipxe/tables.h

+ 2
- 1
src/include/ipxe/tables.h Целия файл

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
 /**

Loading…
Отказ
Запис