This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/67220] GCC fails to properly handle libcall symbol visibility of builtin functions
- From: "edlinger at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 27 Jan 2018 11:19:34 +0000
- Subject: [Bug middle-end/67220] GCC fails to properly handle libcall symbol visibility of builtin functions
- Auto-submitted: auto-generated
- References: <bug-67220-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67220
--- Comment #5 from Bernd Edlinger <edlinger at gcc dot gnu.org> ---
FYI the C++ FE behaves differently:
cat x.cc
typedef __SIZE_TYPE__ size_t;
extern "C" void *memset(void *s, int c, size_t n)
__attribute__ ((visibility ("hidden")));
void
foo1 (void *s, size_t n)
{
memset (s, '\0', n);
}
void
foo2 (void *s, int c, size_t n)
{
memset (s, c, n);
}
gcc -Wall -O2 -fPIC -S x.cc
x.cc:2:18: warning: 'void* memset(void*, int, size_t)': visibility attribute
ignored because it conflicts with previous declaration [-Wattributes]
extern "C" void *memset(void *s, int c, size_t n)
^~~~~~
<built-in>: note: previous declaration of 'void* memset(void*, int, size_t)'