This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.18-695-g3f63707
- From: brooks at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 23 Dec 2013 23:51:27 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.18-695-g3f63707
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 3f637079f549956fe71a363fd82e1b66295deda2 (commit)
from abc26e998f74750850cc02f9c249ee794cbdd8e8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3f637079f549956fe71a363fd82e1b66295deda2
commit 3f637079f549956fe71a363fd82e1b66295deda2
Author: Brooks Moses <bmoses@google.com>
Date: Wed Dec 11 17:46:46 2013 -0800
Define __CORRECT_ISO_CPP_STRING_H_PROTO correctly for Clang.
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.
As per discussion on earlier versions of this patch, rather than
restrict the fix to Clang per se, we assume that all C++ compilers that
claim to fully support C++98 are using a standard-conforming C++
standard library, which seems pretty reasonable. Clang has been
providing an appropriate value of __cplusplus since May 2012.
diff --git a/ChangeLog b/ChangeLog
index 9528f88..584f589 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-12-24 Brooks Moses <bmoses@google.com>
+
+ * string/string.h (__CORRECT_ISO_CPP_STRING_H_PROTO): Define for
+ all compilers that claim C++98 compliance, not just GCC.
+ * string/strings.h (__CORRECT_ISO_CPP_STRINGS_H_PROTO):
+ Likewise.
+
2013-12-24 Maxim Kuvyrkov <maxim@kugelworks.com>
* NEWS: Restore accidentally deleted bug-fix entries.
diff --git a/string/string.h b/string/string.h
index ecc3fef..33d01ad 100644
--- a/string/string.h
+++ b/string/string.h
@@ -31,8 +31,12 @@ __BEGIN_DECLS
#define __need_NULL
#include <stddef.h>
-/* Tell the caller that we provide correct C++ prototypes. */
-#if defined __cplusplus && __GNUC_PREREQ (4, 4)
+/* Provide correct C++ prototypes, and indicate this to the caller. This
+ requires a compatible C++ standard library. As a heuristic, we provide
+ these when the compiler indicates full conformance with C++98 or later,
+ and for older GCC versions that are known to provide a compatible
+ libstdc++. */
+#if defined __cplusplus && (__cplusplus >= 199711L || __GNUC_PREREQ (4, 4))
# define __CORRECT_ISO_CPP_STRING_H_PROTO
#endif
diff --git a/string/strings.h b/string/strings.h
index dad0a04..0d2b5bf 100644
--- a/string/strings.h
+++ b/string/strings.h
@@ -27,8 +27,12 @@
# define __need_size_t
# include <stddef.h>
-/* Tell the caller that we provide correct C++ prototypes. */
-# if defined __cplusplus && __GNUC_PREREQ (4, 4)
+/* Provide correct C++ prototypes, and indicate this to the caller. This
+ requires a compatible C++ standard library. As a heuristic, we provide
+ these when the compiler indicates full conformance with C++98 or later,
+ and for older GCC versions that are known to provide a compatible
+ libstdc++. */
+# if defined __cplusplus && (__cplusplus >= 199711L || __GNUC_PREREQ (4, 4))
# define __CORRECT_ISO_CPP_STRINGS_H_PROTO
# endif
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++++
string/string.h | 8 ++++++--
string/strings.h | 8 ++++++--
3 files changed, 19 insertions(+), 4 deletions(-)
hooks/post-receive
--
GNU C Library master sources