mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-23 13:47:47 +00:00
clang warning fix for #8338
Unlike some other warnings, clang does not have a `stringop-overflow` group so it doesn't recognize the `#pragma GCC ...` directive in #8338
This commit is contained in:
parent
9750e1fa10
commit
fb3f7cebbf
1 changed files with 4 additions and 0 deletions
|
@ -44,12 +44,16 @@ reverse_bytes(signed char size, char *address){
|
||||||
char * first = address;
|
char * first = address;
|
||||||
char * last = first + size - 1;
|
char * last = first + size - 1;
|
||||||
for(;first < last;++first, --last){
|
for(;first < last;++first, --last){
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wstringop-overflow="
|
#pragma GCC diagnostic ignored "-Wstringop-overflow="
|
||||||
|
#endif
|
||||||
char x = *last;
|
char x = *last;
|
||||||
*last = *first;
|
*last = *first;
|
||||||
*first = x;
|
*first = x;
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue