lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] odd/quash_warnings 8faf3a9: Attempt to suppress stri


From: Greg Chicares
Subject: [lmi-commits] [lmi] odd/quash_warnings 8faf3a9: Attempt to suppress stricter warnings for third-party libraries
Date: Sat, 6 Jun 2020 16:40:20 -0400 (EDT)

branch: odd/quash_warnings
commit 8faf3a9a1053857fecf3f8e92a228e517b2399c7
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Attempt to suppress stricter warnings for third-party libraries
    
    It seems much better to use gcc's '-isystem' for third-party headers
    instead, because the present commit doesn't have the desired effect
    (even to the limited extent the idea is carried through here). For
    example, the gcc diagnostics shown below are not suppressed by this
    technique:
    
    In file included \
      from /opt/lmi/third_party/include/boost/detail/shared_count.hpp:28,
      from /opt/lmi/third_party/include/boost/shared_ptr.hpp:26,
      from /opt/lmi/third_party/include/boost/filesystem/operations.hpp:19,
      from /opt/lmi/src/lmi/global_settings.hpp:31,
      from /opt/lmi/src/lmi/path_utility.cpp:28:
    /opt/lmi/third_party/include/boost/detail/bad_weak_ptr.hpp:43:26: \
      error: ‘virtual const char* boost::bad_weak_ptr::what() const’ \
      can be marked override [-Werror=suggest-override]
         virtual char const * what() const throw()
                              ^~~~
    In file included \
      from /opt/lmi/third_party/include/boost/shared_ptr.hpp:26,
      from /opt/lmi/third_party/include/boost/filesystem/operations.hpp:19,
      from /opt/lmi/src/lmi/global_settings.hpp:31,
      from /opt/lmi/src/lmi/path_utility.cpp:28:
    /opt/lmi/third_party/include/boost/detail/shared_count.hpp: \
      In constructor ‘boost::detail::shared_count::shared_count()’:
    /opt/lmi/third_party/include/boost/detail/shared_count.hpp:66:26: \
    error: zero as null pointer constant \
      [-Werror=zero-as-null-pointer-constant]
         shared_count(): pi_(0) // nothrow
                              ^
---
 authenticity.hpp                |  2 ++
 cache_file_reads.hpp            |  2 ++
 emit_ledger.hpp                 |  2 ++
 global_settings.hpp             |  2 ++
 gpt_server.hpp                  |  2 ++
 group_values.hpp                |  2 ++
 illustrator.hpp                 |  2 ++
 ledger_evaluator.hpp            |  2 ++
 ledger_pdf.hpp                  |  2 ++
 md5sum.hpp                      |  2 ++
 mec_server.hpp                  |  2 ++
 path_utility.hpp                |  2 ++
 path_utility_test.cpp           |  2 ++
 pdf_command.hpp                 |  2 ++
 ledger_pdf.hpp => quash_off.hpp | 22 +++++++++----------
 quash_on.hpp                    | 47 +++++++++++++++++++++++++++++++++++++++++
 rate_table.hpp                  |  2 ++
 wx_test_case.hpp                |  2 ++
 wx_test_output.hpp              |  2 ++
 wx_test_output_pdf.hpp          |  2 ++
 xml_serializable.hpp            |  2 ++
 21 files changed, 95 insertions(+), 12 deletions(-)

diff --git a/authenticity.hpp b/authenticity.hpp
index 44f5859..30a5380 100644
--- a/authenticity.hpp
+++ b/authenticity.hpp
@@ -27,7 +27,9 @@
 #include "calendar_date.hpp"
 #include "so_attributes.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/path.hpp>
+#include "quash_off.hpp"
 
 #include <string>
 
diff --git a/cache_file_reads.hpp b/cache_file_reads.hpp
index 64b0cfe..1eabe1a 100644
--- a/cache_file_reads.hpp
+++ b/cache_file_reads.hpp
@@ -26,7 +26,9 @@
 
 #include "assert_lmi.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/operations.hpp>
+#include "quash_off.hpp"
 
 #include <ctime>                        // time_t
 #include <map>
diff --git a/emit_ledger.hpp b/emit_ledger.hpp
index 6ac4cda..45a7afe 100644
--- a/emit_ledger.hpp
+++ b/emit_ledger.hpp
@@ -27,7 +27,9 @@
 #include "mc_enum_type_enums.hpp"       // enum mcenum_emission
 #include "so_attributes.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/path.hpp>
+#include "quash_off.hpp"
 
 #include <memory>                       // unique_ptr
 
diff --git a/global_settings.hpp b/global_settings.hpp
index f564a84..cf0763a 100644
--- a/global_settings.hpp
+++ b/global_settings.hpp
@@ -27,8 +27,10 @@
 #include "calendar_date.hpp"
 #include "so_attributes.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/operations.hpp> // fs::system_complete()
 #include <boost/filesystem/path.hpp>
+#include "quash_off.hpp"
 
 #include <string>
 
diff --git a/gpt_server.hpp b/gpt_server.hpp
index c84905f..8a16043 100644
--- a/gpt_server.hpp
+++ b/gpt_server.hpp
@@ -28,7 +28,9 @@
 #include "mc_enum_type_enums.hpp"       // enum mcenum_emission
 #include "so_attributes.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/path.hpp>
+#include "quash_off.hpp"
 
 class gpt_input;
 
diff --git a/group_values.hpp b/group_values.hpp
index 0b067e0..4595b63 100644
--- a/group_values.hpp
+++ b/group_values.hpp
@@ -27,7 +27,9 @@
 #include "mc_enum_type_enums.hpp"       // enum mcenum_emission
 #include "so_attributes.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/path.hpp>
+#include "quash_off.hpp"
 
 #include <memory>                       // shared_ptr
 #include <vector>
diff --git a/illustrator.hpp b/illustrator.hpp
index 381a9d6..8b9f146 100644
--- a/illustrator.hpp
+++ b/illustrator.hpp
@@ -27,7 +27,9 @@
 #include "mc_enum_type_enums.hpp"       // enum mcenum_emission
 #include "so_attributes.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/path.hpp>
+#include "quash_off.hpp"
 
 #include <memory>                       // shared_ptr
 #include <vector>
diff --git a/ledger_evaluator.hpp b/ledger_evaluator.hpp
index 5f406e4..9a362ca 100644
--- a/ledger_evaluator.hpp
+++ b/ledger_evaluator.hpp
@@ -26,7 +26,9 @@
 
 #include "so_attributes.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/path.hpp>
+#include "quash_off.hpp"
 
 #include <string>
 #include <unordered_map>
diff --git a/ledger_pdf.hpp b/ledger_pdf.hpp
index ea86ee5..da50359 100644
--- a/ledger_pdf.hpp
+++ b/ledger_pdf.hpp
@@ -24,7 +24,9 @@
 
 #include "config.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/path.hpp>
+#include "quash_off.hpp"
 
 #include <string>
 
diff --git a/md5sum.hpp b/md5sum.hpp
index 67d02e4..0e1b09c 100644
--- a/md5sum.hpp
+++ b/md5sum.hpp
@@ -24,7 +24,9 @@
 
 #include "config.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/path.hpp>
+#include "quash_off.hpp"
 
 #include <climits>                      // CHAR_BIT
 #include <iosfwd>
diff --git a/mec_server.hpp b/mec_server.hpp
index e7e3ae3..19fffb5 100644
--- a/mec_server.hpp
+++ b/mec_server.hpp
@@ -28,7 +28,9 @@
 #include "mec_state.hpp"
 #include "so_attributes.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/path.hpp>
+#include "quash_off.hpp"
 
 class mec_input;
 
diff --git a/path_utility.hpp b/path_utility.hpp
index 1cf1468..6335518 100644
--- a/path_utility.hpp
+++ b/path_utility.hpp
@@ -26,7 +26,9 @@
 
 #include "so_attributes.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/path.hpp>
+#include "quash_off.hpp"
 
 #include <ostream>
 #include <string>
diff --git a/path_utility_test.cpp b/path_utility_test.cpp
index 14bc17b..cc470e8 100644
--- a/path_utility_test.cpp
+++ b/path_utility_test.cpp
@@ -27,11 +27,13 @@
 #include "platform_dependent.hpp"       // access()
 #include "test_tools.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/convenience.hpp> // basename()
 #include <boost/filesystem/exception.hpp>
 #include <boost/filesystem/fstream.hpp>
 #include <boost/filesystem/operations.hpp>
 #include <boost/filesystem/path.hpp>
+#include "quash_off.hpp"
 
 #include <cstdio>                       // remove()
 #include <fstream>
diff --git a/pdf_command.hpp b/pdf_command.hpp
index cab3aa5..32a6e4c 100644
--- a/pdf_command.hpp
+++ b/pdf_command.hpp
@@ -26,7 +26,9 @@
 
 #include "so_attributes.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/path.hpp>
+#include "quash_off.hpp"
 
 class Ledger;
 
diff --git a/ledger_pdf.hpp b/quash_off.hpp
similarity index 73%
copy from ledger_pdf.hpp
copy to quash_off.hpp
index ea86ee5..318a2d4 100644
--- a/ledger_pdf.hpp
+++ b/quash_off.hpp
@@ -1,6 +1,6 @@
-// Ledger PDF generation.
+// Suppress certain warnings for third-party code.
 //
-// Copyright (C) 2017, 2018, 2019, 2020 Gregory W. Chicares.
+// Copyright (C) 2020 Gregory W. Chicares.
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License version 2 as
@@ -19,17 +19,15 @@
 // email: <gchicares@sbcglobal.net>
 // snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
 
-#ifndef ledger_pdf_hpp
-#define ledger_pdf_hpp
+#ifndef quash_off_hpp
+#define quash_off_hpp
 
 #include "config.hpp"
 
-#include <boost/filesystem/path.hpp>
+#if defined __clang__
+#   pragma clang diagnostic pop
+#elif defined __GNUC__
+#   pragma GCC diagnostic pop
+#endif // defined __GNUC__
 
-#include <string>
-
-class Ledger;
-
-std::string write_ledger_as_pdf(Ledger const&, fs::path const&);
-
-#endif // ledger_pdf_hpp
+#endif // quash_off_hpp
diff --git a/quash_on.hpp b/quash_on.hpp
new file mode 100644
index 0000000..07be9b7
--- /dev/null
+++ b/quash_on.hpp
@@ -0,0 +1,47 @@
+// Suppress certain warnings for third-party code.
+//
+// Copyright (C) 2020 Gregory W. Chicares.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as
+// published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software Foundation,
+// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+//
+// http://savannah.nongnu.org/projects/lmi
+// email: <gchicares@sbcglobal.net>
+// snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
+
+#ifndef quash_on_hpp
+#define quash_on_hpp
+
+#include "config.hpp"
+
+#if defined __clang__
+#   pragma clang diagnostic push
+//#   pragma clang diagnostic ignored "-Wdeprecated-declarations"
+//#   pragma clang diagnostic ignored "-Wdeprecated-copy"
+#elif defined __GNUC__
+#   pragma GCC diagnostic push
+#   if 7 <= __GNUC__
+//#       pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+#       pragma GCC diagnostic ignored "-Wold-style-cast"
+#       pragma GCC diagnostic ignored "-Wsuggest-override"
+#       pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
+//#       pragma GCC diagnostic ignored "-Wregister"
+//#       pragma GCC diagnostic ignored "-Wuseless-cast"
+#       if 10 <= __GNUC__
+//#           pragma GCC diagnostic ignored "-Wdeprecated-copy"
+#       endif // 10 <= __GNUC__
+#   endif // 7 <= __GNUC__
+//#   pragma GCC diagnostic ignored "-Wshadow"
+#endif // defined __GNUC__
+
+#endif // quash_on_hpp
diff --git a/rate_table.hpp b/rate_table.hpp
index b8889b2..e822cf9 100644
--- a/rate_table.hpp
+++ b/rate_table.hpp
@@ -24,7 +24,9 @@
 
 #include "config.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/path.hpp>
+#include "quash_off.hpp"
 
 #include <cstddef>                      // size_t
 #include <cstdint>
diff --git a/wx_test_case.hpp b/wx_test_case.hpp
index 03278eb..df6e99a 100644
--- a/wx_test_case.hpp
+++ b/wx_test_case.hpp
@@ -24,7 +24,9 @@
 
 #include "config.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/path.hpp>
+#include "quash_off.hpp"
 
 /// Base class for the test case objects.
 ///
diff --git a/wx_test_output.hpp b/wx_test_output.hpp
index fbb11e9..3a4772c 100644
--- a/wx_test_output.hpp
+++ b/wx_test_output.hpp
@@ -24,7 +24,9 @@
 
 #include "config.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/operations.hpp>
+#include "quash_off.hpp"
 
 /// Class helping to check for the expected output file existence.
 ///
diff --git a/wx_test_output_pdf.hpp b/wx_test_output_pdf.hpp
index efb2759..0d181ea 100644
--- a/wx_test_output_pdf.hpp
+++ b/wx_test_output_pdf.hpp
@@ -27,7 +27,9 @@
 #include "configurable_settings.hpp"
 #include "wx_test_output.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/operations.hpp>
+#include "quash_off.hpp"
 
 /// Specialized version of output_file_existence_checker for the output PDF
 /// files: it takes just the base name of the file, without neither the
diff --git a/xml_serializable.hpp b/xml_serializable.hpp
index 30dede4..7f0cd16 100644
--- a/xml_serializable.hpp
+++ b/xml_serializable.hpp
@@ -27,7 +27,9 @@
 #include "so_attributes.hpp"
 #include "xml_lmi_fwd.hpp"
 
+#include "quash_on.hpp"
 #include <boost/filesystem/path.hpp>
+#include "quash_off.hpp"
 
 #include <list>
 #include <map>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]