瀏覽代碼

[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 年之前
父節點
當前提交
511fd46976
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2
    1
      src/include/ipxe/tables.h

+ 2
- 1
src/include/ipxe/tables.h 查看文件

@@ -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…
取消
儲存