Skip to content

Commit

Permalink
clang warning fix for monero-project#8338
Browse files Browse the repository at this point in the history
Unlike some other warnings, clang does not have a `stringop-overflow` group so it doesn't recognize the `#pragma GCC ...` directive in monero-project#8338
  • Loading branch information
Jeffrey Ryan committed May 28, 2022
1 parent 9750e1f commit fb3f7ce
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions external/boost/archive/portable_binary_archive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,16 @@ reverse_bytes(signed char size, char *address){
char * first = address;
char * last = first + size - 1;
for(;first < last;++first, --last){
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-overflow="
#endif
char x = *last;
*last = *first;
*first = x;
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
}
}

Expand Down

0 comments on commit fb3f7ce

Please sign in to comment.