GCC: Fix -Wstringop-overflow= warnings

Resolves #8320
This commit is contained in:
Jeffrey Ryan 2022-05-16 19:13:02 -05:00
parent 6e60919e6d
commit 5858f05f9b
1 changed files with 3 additions and 0 deletions

View File

@ -44,9 +44,12 @@ reverse_bytes(signed char size, char *address){
char * first = address;
char * last = first + size - 1;
for(;first < last;++first, --last){
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-overflow="
char x = *last;
*last = *first;
*first = x;
#pragma GCC diagnostic pop
}
}