Skip to content

Commit

Permalink
Ignore deprecation warnings for codecvt and iostreams
Browse files Browse the repository at this point in the history
  • Loading branch information
jimporter committed May 2, 2024
1 parent f09b0ff commit 145ef63
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 6 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ jobs:
boost-version: '1.80.0'}

# macOS builds
# FIXME: Remove -Wno-deprecated flag.
- {os: macos-latest, compiler: clang, flags: '-Wno-deprecated'}
- {os: macos-latest, compiler: clang}

# Boost 1.58 builds
# (Test 1.58 specifically because it has very strict rules for
Expand All @@ -73,9 +72,8 @@ jobs:
flags: '-DNDEBUG', extra-desc: 'NDEBUG'}
- {os: windows-latest, compiler: msvc, flags: '/DNDEBUG',
version: '14.3', boost-version: '1.80.0', extra-desc: 'NDEBUG'}
# FIXME: Remove -Wno-deprecated flag.
- {os: macos-latest, compiler: clang,
flags: '-Wno-deprecated -DNDEBUG', extra-desc: 'NDEBUG'}
- {os: macos-latest, compiler: clang, flags: '-DNDEBUG',
extra-desc: 'NDEBUG'}

# C++20 builds
- {os: ubuntu-latest, compiler: gcc, version: '13',
Expand Down
7 changes: 6 additions & 1 deletion include/mettle/output/string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,13 @@ namespace mettle {
return s;
}

// Ignore warnings from MSVC about deprecated <codecvt>
// Ignore warnings about deprecated <codecvt>
#if defined(_MSC_VER) && !defined(__clang__)
# pragma warning(push)
# pragma warning(disable:4996)
#elif defined(__GNUG__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated"
#endif

inline std::string
Expand Down Expand Up @@ -126,6 +129,8 @@ namespace mettle {

#if defined(_MSC_VER) && !defined(__clang__)
# pragma warning(pop)
#elif defined(__GNUG__)
# pragma GCC diagnostic pop
#endif

}
Expand Down
12 changes: 12 additions & 0 deletions src/libmettle/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@
#include <vector>

#define NOMINMAX

// Ignore warnings about deprecated implicit copy constructor.
#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-copy"
#endif

#include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/iostreams/stream.hpp>

#if defined(__clang__)
# pragma clang diagnostic pop
#endif

#include <boost/program_options.hpp>

#include <mettle/driver/cmd_line.hpp>
Expand Down
10 changes: 10 additions & 0 deletions src/mettle/posix/run_test_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,19 @@
#include <cstdint>
#include <sstream>

// Ignore warnings about deprecated implicit copy constructor.
#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-copy"
#endif

#include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/iostreams/stream.hpp>

#if defined(__clang__)
# pragma clang diagnostic pop
#endif

#include <mettle/detail/source_location.hpp>
#include <mettle/driver/exit_code.hpp>
#include <mettle/driver/posix/scoped_pipe.hpp>
Expand Down
10 changes: 10 additions & 0 deletions src/mettle/windows/run_test_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@
#include <sstream>
#include <iomanip>

// Ignore warnings about deprecated implicit copy constructor.
#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-copy"
#endif

#include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/iostreams/stream.hpp>

#if defined(__clang__)
# pragma clang diagnostic pop
#endif

#include <mettle/detail/source_location.hpp>
#include <mettle/driver/windows/scoped_pipe.hpp>

Expand Down

0 comments on commit 145ef63

Please sign in to comment.