This is the mail archive of the
mailing list for the glibc project.
Re: [patch] Define __CORRECT_ISO_CPP_STRING_H_PROTO correctly for Clang
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Brooks Moses <bmoses at google dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 29 Aug 2013 12:18:13 +0000
- Subject: Re: [patch] Define __CORRECT_ISO_CPP_STRING_H_PROTO correctly for Clang
- Authentication-results: sourceware.org; auth=none
- References: <CAOxa4Kqcbq-X871-kfNt4FDd1ae1ttSHj8fSBGEY3QqzcfaBCA at mail dot gmail dot com>
On Wed, 28 Aug 2013, Brooks Moses wrote:
> In the string/string.h and string/strings.h headers, we have a couple
> of macros that "tell the caller that we provide correct C++
> prototypes" according to the comment; they are used to determine
> whether to wrap some prototypes in "extern "C++"" (and provide
> multiple overloads of them, and some other magic) when __cplusplus is
> The macros are set to check for sufficiently-recent GCC versions (4.4
> and later), but this is not the right check for non-GCC compilers. In
> particular, these macros should also be set when using Clang -- if
> they are not set, then Clang will be unable to correctly diagnose a
> number of subtle bugs that will be errors in GCC compilations.
What's the logic behind the GCC version check in the first place? Is it
about compiler (language) features, or about corresponding support in the
standard C++ library? If the former, do you need a Clang version check?
If the latter, do you need a check on what version of libstdc++ or libc++
might be used with Clang?
Does any C++ library use these macros, or are they purely used within
glibc to determine what glibc's own headers declare?
Joseph S. Myers