This is the mail archive of the libc-alpha@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]

Re: [patch] Define __CORRECT_ISO_CPP_STRING_H_PROTO correctly for Clang


On Wed, Aug 28, 2013 at 5:38 PM, Brooks Moses <bmoses@google.com> 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
> defined.
>
> 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.
>
> The attached patch thus adds the trivial change to make these headers
> work correctly with Clang.  We've been carrying it locally for a
> while, but I'd rather have it upstream.


What about checking if __cplusplus >= the value for C++98 for non GCC compilers?

Thanks,
Andrew Pinski

>
> Ok for trunk?
>
> Thanks,
> - Brooks


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