File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
regression/ansi-c/gcc_attributes12 Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 11CORE gcc-only
22main.c
3-
3+ -Wall
44^EXIT=0$
55^SIGNAL=0$
66--
7+ 'extern' symbol 'my_ids_table' should not have an initializer
78^warning: ignoring
89^CONVERSION ERROR$
Original file line number Diff line number Diff line change @@ -73,13 +73,14 @@ void c_typecheck_baset::typecheck_symbol(symbolt &symbol)
7373 new_name=root_name;
7474 symbol.is_static_lifetime =true ;
7575
76- if (symbol.value .is_not_nil ())
76+ if (symbol.value .is_not_nil () && !symbol. is_macro )
7777 {
7878 // According to the C standard this should be an error, but at least some
7979 // versions of Visual Studio insist to use this in their C library, and
8080 // GCC just warns as well.
8181 warning ().source_location = symbol.value .find_source_location ();
82- warning () << " `extern' symbol should not have an initializer" << eom;
82+ warning () << " 'extern' symbol '" << new_name
83+ << " ' should not have an initializer" << eom;
8384 }
8485 }
8586 else if (!is_function && symbol.value .id ()==ID_code)
You can’t perform that action at this time.
0 commit comments