diff --git a/include/eepp/core/string.hpp b/include/eepp/core/string.hpp index 3ffd4013c..a18832af1 100644 --- a/include/eepp/core/string.hpp +++ b/include/eepp/core/string.hpp @@ -346,6 +346,8 @@ class EE_API String { #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wformat-security" +#elif defined( __GNUC__ ) +#pragma GCC diagnostic warning "-Wformat-security" #endif int size = std::snprintf( nullptr, 0, format.data(), @@ -359,6 +361,8 @@ class EE_API String { } #ifdef __clang__ #pragma clang diagnostic pop +#elif defined( __GNUC__ ) +#pragma diagnostic pop #endif return result; } diff --git a/src/tools/ecode/plugins/git/git.cpp b/src/tools/ecode/plugins/git/git.cpp index b7c0d66a6..c574964b7 100644 --- a/src/tools/ecode/plugins/git/git.cpp +++ b/src/tools/ecode/plugins/git/git.cpp @@ -327,7 +327,7 @@ std::vector Git::getAllBranchesAndTags( RefType ref, const std::str auto headOrigins = getHeadOrigins( projectDir ); - readAllLines( buf, [&branches, ref, &headOrigins, this]( const std::string_view& line ) { + readAllLines( buf, [&]( const std::string_view& line ) { auto branch = String::trim( String::trim( line, '\n' ), '\'' ); if ( ( ref & Head ) && String::startsWith( branch, "refs/heads/" ) ) { branches.emplace_back( parseLocalBranch( branch, headOrigins ) ); diff --git a/src/tools/ecode/plugins/git/git.hpp b/src/tools/ecode/plugins/git/git.hpp index 9fe975e3a..edb41b9d4 100644 --- a/src/tools/ecode/plugins/git/git.hpp +++ b/src/tools/ecode/plugins/git/git.hpp @@ -1,6 +1,7 @@ #include #include #include +#include #include namespace ecode {