Skip to content

Commit de33a6a

Browse files
authored
fix: Add -Wno-deprecated-declarations for Clang only (#5680)
This change adds `-Wno-deprecated-declarations` for Clang only (not for GCC) builds in `cmake/RippledCompiler.cmake`.
1 parent 28eec6c commit de33a6a

File tree

3 files changed

+2
-36
lines changed

3 files changed

+2
-36
lines changed

cmake/RippledCompiler.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ else ()
9494
INTERFACE
9595
-Wall
9696
-Wdeprecated
97+
$<$<BOOL:${is_clang}>:-Wno-deprecated-declarations>
9798
$<$<BOOL:${wextra}>:-Wextra -Wno-unused-parameter>
9899
$<$<BOOL:${werr}>:-Werror>
99100
-fstack-protector

include/xrpl/basics/Expected.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,8 @@
2222

2323
#include <xrpl/basics/contract.h>
2424

25-
#if defined(__clang__)
26-
#pragma clang diagnostic push
27-
#pragma clang diagnostic ignored "-Wdeprecated"
28-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
29-
#endif
30-
3125
#include <boost/outcome.hpp>
3226

33-
#if defined(__clang__)
34-
#pragma clang diagnostic pop
35-
#endif
36-
3727
#include <stdexcept>
3828

3929
namespace ripple {

include/xrpl/beast/hash/hash_append.h

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,10 @@
2424
#include <boost/container/flat_set.hpp>
2525
#include <boost/endian/conversion.hpp>
2626

27-
/*
28-
29-
Workaround for overzealous clang warning, which trips on libstdc++ headers
30-
31-
In file included from
32-
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algo.h:61:
33-
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tempbuf.h:263:8:
34-
error: 'get_temporary_buffer<std::pair<ripple::Quality, const
35-
std::vector<std::unique_ptr<ripple::Step>> *>>' is deprecated
36-
[-Werror,-Wdeprecated-declarations] 263 |
37-
std::get_temporary_buffer<value_type>(_M_original_len));
38-
^
39-
*/
40-
41-
#if defined(__clang__)
42-
#pragma clang diagnostic push
43-
#pragma clang diagnostic ignored "-Wdeprecated"
44-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
45-
#endif
46-
47-
#include <functional>
48-
49-
#if defined(__clang__)
50-
#pragma clang diagnostic pop
51-
#endif
52-
5327
#include <array>
5428
#include <chrono>
5529
#include <cstring>
30+
#include <functional>
5631
#include <memory>
5732
#include <string>
5833
#include <system_error>

0 commit comments

Comments
 (0)