Skip to content

Commit 536d6a2

Browse files
authored
Merge pull request #5731 from tautschnig/attribute-alias
GCC attribute alias should not trigger warning
2 parents 91fadf4 + d93e564 commit 536d6a2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
CORE gcc-only
22
main.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$

src/ansi-c/c_typecheck_base.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)