This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/67220] GCC fails to properly handle libcall symbol visibility of builtin functions


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)'

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]