diff options
author | Kamlesh Kumar <kamleshbhalui@gmail.com> | 2019-12-05 16:49:00 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2019-12-05 16:50:00 +0100 |
commit | 953ceff17a4a15b10cfdd5edc3c8cae4884c8ec3 (patch) | |
tree | f42e201d4ccf6d44b249579387444ed11c1d4d99 /string | |
parent | build-many-glibcs.py: Move sparcv8 to extra_glibcs (diff) | |
download | glibc-953ceff17a4a15b10cfdd5edc3c8cae4884c8ec3.tar.gz glibc-953ceff17a4a15b10cfdd5edc3c8cae4884c8ec3.tar.bz2 glibc-953ceff17a4a15b10cfdd5edc3c8cae4884c8ec3.zip |
<string.h>: Define __CORRECT_ISO_CPP_STRING_H_PROTO for Clang [BZ #25232]
Without the asm redirects, strchr et al. are not const-correct.
libc++ has a wrapper header that works with and without
__CORRECT_ISO_CPP_STRING_H_PROTO (using a Clang extension). But when
Clang is used with libstdc++ or just C headers, the overloaded functions
with the correct types are not declared.
This change does not impact current GCC (with libstdc++ or libc++).
Diffstat (limited to 'string')
-rw-r--r-- | string/string.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/string/string.h b/string/string.h index 73c22a535a..faf997b972 100644 --- a/string/string.h +++ b/string/string.h @@ -33,7 +33,8 @@ __BEGIN_DECLS #include <stddef.h> /* Tell the caller that we provide correct C++ prototypes. */ -#if defined __cplusplus && __GNUC_PREREQ (4, 4) +#if defined __cplusplus && (__GNUC_PREREQ (4, 4) \ + || __glibc_clang_prereq (3, 5)) # define __CORRECT_ISO_CPP_STRING_H_PROTO #endif |