This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Prevent GCC 6 <cstdlib> from including /usr/include/stdlib.h
- From: fweimer at redhat dot com (Florian Weimer)
- To: libc-alpha at sourceware dot org
- Date: Wed, 08 Jun 2016 17:08:24 +0200
- Subject: [PATCH] Prevent GCC 6 <cstdlib> from including /usr/include/stdlib.h
- Authentication-results: sourceware.org; auth=none
Otherwise, /usr/include/stdlib.h turns up as a make dependency,
and an implicit rule will kick and make will try to install
stdlib/stdlib.h as /usr/include/stdlib.h because the target
is out of date.
2016-06-08 Florian Weimer <fweimer@redhat.com>
Prevent GCC 6 <cstdlib> from including /usr/include/stdlib.h.
* stdlib/tst-quick_exit.cc: Include <stdlib.h> before <cstdlib>.
* stdlib/tst-thread-quick_exit.cc: Likewise.
diff --git a/stdlib/tst-quick_exit.cc b/stdlib/tst-quick_exit.cc
index c4a15a9..6e6a503 100644
--- a/stdlib/tst-quick_exit.cc
+++ b/stdlib/tst-quick_exit.cc
@@ -15,6 +15,8 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+
+#include <stdlib.h>
#include <cstdlib>
struct A
diff --git a/stdlib/tst-thread-quick_exit.cc b/stdlib/tst-thread-quick_exit.cc
index 307d2a2..703f8c1 100644
--- a/stdlib/tst-thread-quick_exit.cc
+++ b/stdlib/tst-thread-quick_exit.cc
@@ -15,6 +15,8 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+
+#include <stdlib.h>
#include <cstdlib>
#include <thread>