[PATCH] Prevent GCC 6 <cstdlib> from including /usr/include/stdlib.h

Florian Weimer fweimer@redhat.com
Wed Jun 8 15:08:00 GMT 2016


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>
 



More information about the Libc-alpha mailing list