This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc 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 libc/17631] Implementation of __CORRECT_ISO_CPP_STRING_H_PROTO relies on GCC extensions


https://sourceware.org/bugzilla/show_bug.cgi?id=17631

Richard Smith <richard at metafoo dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |richard at metafoo dot co.uk
         Resolution|FIXED                       |---

--- Comment #4 from Richard Smith <richard at metafoo dot co.uk> ---
This change regresses glibc's support for Clang, and means that glibc no longer
provides correct prototypes for <string.h> and <wchar.h> functions for C++ for
any compiler other than GCC. There's no way for a C++ standard library to work
around it (without relying on compiler extensions).


If __asm is not available, the same result can be achieved by defining the C++
signatures of (eg) memchr in terms of the C signature:

__extern_always_inline void *
__call_memchr(const void *__s, int __c, size_t __n) __THROW
{
  extern void *memchr(const void *, int, size_t);
  return memchr(__s, __c, __n);
}

extern "C++" inline void *
memchr(void *__s, int __c, size_t __n) __THROW
{
  __call_memchr(__s, __c, __n);
}

extern "C++" inline const void *
memchr(const void *__s, int __c, size_t __n) __THROW
{
  __call_memchr(__s, __c, __n);
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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