From 31df3b8bd4f11f0d7470b2aeca9bcf4ffa491163 Mon Sep 17 00:00:00 2001 From: leoTlr Date: Thu, 4 Apr 2019 00:24:25 +0200 Subject: [PATCH 1/3] compile with -Wextra --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e4d6793..07810da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ cmake_minimum_required (VERSION 2.8.11) project (cpp-jwt) #SET (CMAKE_CXX_COMPILER /usr/local/bin/g++) -SET( CMAKE_CXX_FLAGS "-std=c++14 -Wall" ) +SET( CMAKE_CXX_FLAGS "-std=c++14 -Wall -Wextra" ) include_directories (include) From a3a0d9c0ec9f30887aa06157b6b1804d0c6098c7 Mon Sep 17 00:00:00 2001 From: leoTlr Date: Thu, 4 Apr 2019 00:26:54 +0200 Subject: [PATCH 2/3] prevent -Wunused-parameter warning with gcc 8.2.1 --- include/jwt/impl/jwt.ipp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/jwt/impl/jwt.ipp b/include/jwt/impl/jwt.ipp index 197a614..01b0881 100644 --- a/include/jwt/impl/jwt.ipp +++ b/include/jwt/impl/jwt.ipp @@ -607,6 +607,7 @@ void jwt_object::set_decode_params(DecodeParams& dparams, params::detail::valida template void jwt_object::set_decode_params(DecodeParams& dparams) { + (void) dparams; // prevent -Wunused-parameter with gcc return; } From 4234eea1bf9e7929a508aea2839f5f7fbb579bc1 Mon Sep 17 00:00:00 2001 From: leoTlr Date: Thu, 4 Apr 2019 00:27:39 +0200 Subject: [PATCH 3/3] prevent -Wimplicit-fallthrough= warning with gcc 8.2.1 --- include/jwt/base64.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/jwt/base64.hpp b/include/jwt/base64.hpp index 226c1f0..4cb28d7 100644 --- a/include/jwt/base64.hpp +++ b/include/jwt/base64.hpp @@ -229,16 +229,16 @@ inline std::string base64_decode(const char* in, size_t len) const auto fourth = dmap.at(in[3]); result[i + 2] = (third << 6) | fourth; bytes_wr++; - //FALLTHROUGH } + //FALLTHROUGH case 3: { const auto second = dmap.at(in[1]); const auto third = dmap.at(in[2]); result[i + 1] = (second << 4) | (third >> 2); bytes_wr++; - //FALLTHROUGH } + //FALLTHROUGH case 2: { const auto first = dmap.at(in[0]);