-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Low
-
Code Generation Tools
-
CODEGEN-11065
-
ARM_20.2.7.LTS
-
default
The attached source file has these lines ...
#define DEFINE_THIS_MODULE_NAME(_name_) \
_Pragma("diag_push") \
_Pragma("diag_suppress 179") \
static char const g_this_module_name[] = #_name_; \
_Pragma("diag_pop")
// Sees diagnostic 179
DEFINE_THIS_MODULE_NAME(test0)
// Does not see diagnostic 179
_Pragma("diag_push") _Pragma("diag_suppress 179") static char const also_not_used[] = "test1"; _Pragma("diag_pop")
It uses _Pragma("diag_suppress 179") twice. The first time is from inside a macro. The second time is outside a macro. Build it ...
% armcl --display_error_number file.c "file.c", line 8: warning #179-D: variable "g_this_module_name" was declared but never referenced
The diag_suppress from inside the macro is ignored. The second one, which is the same except for being outside any macro, correctly suppresses the diagnostic.