This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

v3 PATCH to avoid -Wsized-deallocation warnings with C++14 compiler


When GCC defaults to C++14, it gives -Wsized-deallocation warnings for the non-sized operator deletes. We dealt with this for the sized ones by passing -Wno-sized-deallocation on the command line, but using #pragma GCC diagnostic seems cleaner to me.

Applying to trunk.
commit 35cc1a3b6855a3e2e798d389674c98b6d5c24ffa
Author: Jason Merrill <jason@redhat.com>
Date:   Wed May 20 14:21:48 2015 -0400

    	* libsupc++/del_opv.cc: Suppress -Wsized-deallocation.
    	* libsupc++/del_op.cc: Likewise.

diff --git a/libstdc++-v3/libsupc++/del_op.cc b/libstdc++-v3/libsupc++/del_op.cc
index 06eb2a0..8e7aa2f 100644
--- a/libstdc++-v3/libsupc++/del_op.cc
+++ b/libstdc++-v3/libsupc++/del_op.cc
@@ -40,6 +40,9 @@ _GLIBCXX_END_NAMESPACE_VERSION
 
 #include "new"
 
+// The sized deletes are defined in other files.
+#pragma GCC diagnostic ignored "-Wsized-deallocation"
+
 _GLIBCXX_WEAK_DEFINITION void
 operator delete(void* ptr) _GLIBCXX_USE_NOEXCEPT
 {
diff --git a/libstdc++-v3/libsupc++/del_opv.cc b/libstdc++-v3/libsupc++/del_opv.cc
index 6fc1710..0a050bb 100644
--- a/libstdc++-v3/libsupc++/del_opv.cc
+++ b/libstdc++-v3/libsupc++/del_opv.cc
@@ -26,6 +26,9 @@
 #include <bits/c++config.h>
 #include "new"
 
+// The sized deletes are defined in other files.
+#pragma GCC diagnostic ignored "-Wsized-deallocation"
+
 _GLIBCXX_WEAK_DEFINITION void
 operator delete[] (void *ptr) _GLIBCXX_USE_NOEXCEPT
 {

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