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 1
1
CORE gcc-only
2
2
main.c
3
-
3
+ -Wall
4
4
^EXIT=0$
5
5
^SIGNAL=0$
6
6
--
7
+ 'extern' symbol 'my_ids_table' should not have an initializer
7
8
^warning: ignoring
8
9
^CONVERSION ERROR$
Original file line number Diff line number Diff line change @@ -73,13 +73,14 @@ void c_typecheck_baset::typecheck_symbol(symbolt &symbol)
73
73
new_name=root_name;
74
74
symbol.is_static_lifetime =true ;
75
75
76
- if (symbol.value .is_not_nil ())
76
+ if (symbol.value .is_not_nil () && !symbol. is_macro )
77
77
{
78
78
// According to the C standard this should be an error, but at least some
79
79
// versions of Visual Studio insist to use this in their C library, and
80
80
// GCC just warns as well.
81
81
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;
83
84
}
84
85
}
85
86
else if (!is_function && symbol.value .id ()==ID_code)
You can’t perform that action at this time.
0 commit comments