public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/google/grte/v5-2.27/master] <string.h>: Define __CORRECT_ISO_CPP_STRING_H_PROTO for Clang [BZ #25232]
@ 2022-05-25  4:21 Fangrui Song
  0 siblings, 0 replies; only message in thread
From: Fangrui Song @ 2022-05-25  4:21 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2fa202fdd10de62ca436d567f12ccc3e40f29476

commit 2fa202fdd10de62ca436d567f12ccc3e40f29476
Author: Kamlesh Kumar <kamleshbhalui@gmail.com>
Date:   Thu Dec 5 16:49:00 2019 +0100

    <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++).
    
    (cherry picked from commit 953ceff17a4a15b10cfdd5edc3c8cae4884c8ec3)

Diff:
---
 string/string.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/string/string.h b/string/string.h
index 150cfd8b13..22cd0fa08f 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-25  4:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25  4:21 [glibc/google/grte/v5-2.27/master] <string.h>: Define __CORRECT_ISO_CPP_STRING_H_PROTO for Clang [BZ #25232] Fangrui Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).