From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118123 invoked by alias); 5 Dec 2019 15:50:22 -0000 Mailing-List: contact glibc-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: glibc-cvs-owner@sourceware.org List-Subscribe: Received: (qmail 114986 invoked by uid 9299); 5 Dec 2019 15:50:21 -0000 Date: Thu, 05 Dec 2019 15:50:00 -0000 Message-ID: <20191205155021.114975.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc] : Define __CORRECT_ISO_CPP_STRING_H_PROTO for Clang [BZ #25232] X-Act-Checkin: glibc X-Git-Author: Kamlesh Kumar X-Git-Refname: refs/heads/master X-Git-Oldrev: 066d80a7cdfa5ab7b2dd66cb51e8abeed60227e5 X-Git-Newrev: 953ceff17a4a15b10cfdd5edc3c8cae4884c8ec3 X-SW-Source: 2019-q4/txt/msg00540.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=953ceff17a4a15b10cfdd5edc3c8cae4884c8ec3 commit 953ceff17a4a15b10cfdd5edc3c8cae4884c8ec3 Author: Kamlesh Kumar Date: Thu Dec 5 16:49:00 2019 +0100 : 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++). Diff: --- string/string.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/string/string.h b/string/string.h index 73c22a5..faf997b 100644 --- a/string/string.h +++ b/string/string.h @@ -33,7 +33,8 @@ __BEGIN_DECLS #include /* 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