Silence GCC warnings

This commit is contained in:
blankie 2023-06-09 19:29:19 +07:00
parent edbd11e075
commit ca0f5e8a17
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
3 changed files with 3 additions and 2 deletions

View File

@ -19,7 +19,6 @@ if (CMAKE_BUILD_TYPE MATCHES "Debug")
endif()
# https://t.me/NightShadowsHangout/670691
# # https://t.me/NightShadowsHangout/688372
list(APPEND FLAGS -Werror -Wall -Wextra -Wshadow -Wpedantic -Wno-gnu-anonymous-struct -fPIC -fno-rtti -Wconversion -Wno-unused-parameter -Wimplicit-fallthrough)
# i have no idea why this hack wasn't needed before but it's needed if sanitizers are used

View File

@ -6,8 +6,10 @@
#include <exception>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wc99-extensions"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wpedantic"
#include <hiredis.h>
#pragma GCC diagnostic pop

View File

@ -147,7 +147,7 @@ bool PixivClient::i_pximg_url_valid(const std::string& path) {
static void to_lower(std::string& str) {
for (size_t i = 0; i < str.size(); i++) {
if (str[i] >= 'A' && str[i] <= 'Z') {
str[i] = str[i] - 'A' + 'a';
str[i] = static_cast<char>(str[i] - 'A' + 'a');
}
}
}