-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Including Crypto++ headers disables warnings #793
Comments
Thanks @espindola, For the library, it is a "pick your poison". If we don't use If we silence the warning, then we get your bug reports. In this case I think the best thing to do is for you to remove the pragma from You might also consider asking GCC to move Here's a sampling of your preferred configuration. In the build below I removed the pragma from
|
This was added to misc.h due to the noise created by NumericLimitsMin and NumericLimitsMax. It should make it easier to remove -Wno-unused-function from config.h.
Commit b29faeab58e7 should help you remove |
Can't the declaration be marked with attirbute((unused)) instead? |
I'm closing this out. This is about as far as I want to go. I suggest a GCC bug report that asks GCC to stop flagging C++ functions in headers as unused. They are expected. |
What GCC version are you using? I don't see those warnings for
diff --git a/config.h b/config.h
index eccba009..2a058ddf 100644
--- a/config.h
+++ b/config.h
@@ -424,7 +424,6 @@ NAMESPACE_END
// [GCC Bug 53431] "C++ preprocessor ignores #pragma GCC diagnostic". Clang honors it.
#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE
# pragma GCC diagnostic ignored "-Wunknown-pragmas"
-# pragma GCC diagnostic ignored "-Wunused-function"
#endif
// You may need to force include a C++ header on Android when using STLPort to ensure
diff --git a/misc.h b/misc.h
index 67e399d4..6b6dd73c 100644
--- a/misc.h
+++ b/misc.h
@@ -23,7 +23,6 @@
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wconversion"
# pragma GCC diagnostic ignored "-Wsign-conversion"
-# pragma GCC diagnostic ignored "-Wunused-function"
#endif
#include "cryptlib.h" $ CXXFLAGS="-DNDEBUG -g2 -O3 -Wall" make -j 4
crc_simd.cpp:46:17: warning: ‘void CryptoPP::SigIllHandler(int)’ defined but not used [-Wunused-function]
static void SigIllHandler(int)
^~~~~~~~~~~~~
gcm_simd.cpp:79:17: warning: ‘void CryptoPP::SigIllHandler(int)’ defined but not used [-Wunused-function]
static void SigIllHandler(int)
^~~~~~~~~~~~~
neon_simd.cpp:43:14: warning: ‘void CryptoPP::SigIllHandler(int)’ defined but not used [-Wunused-function]
static void SigIllHandler(int)
^~~~~~~~~~~~~
ppc_power7.cpp:33:17: warning: ‘void CryptoPP::SigIllHandler(int)’ defined but not used [-Wunused-function]
static void SigIllHandler(int)
^~~~~~~~~~~~~
ppc_power8.cpp:33:17: warning: ‘void CryptoPP::SigIllHandler(int)’ defined but not used [-Wunused-function]
static void SigIllHandler(int)
^~~~~~~~~~~~~
ppc_power9.cpp:33:17: warning: ‘void CryptoPP::SigIllHandler(int)’ defined but not used [-Wunused-function]
static void SigIllHandler(int)
^~~~~~~~~~~~~
ppc_simd.cpp:36:17: warning: ‘void CryptoPP::SigIllHandler(int)’ defined but not used [-Wunused-function]
static void SigIllHandler(int)
^~~~~~~~~~~~~
rijndael_simd.cpp:77:17: warning: ‘void CryptoPP::SigIllHandler(int)’ defined but not used [-Wunused-function]
static void SigIllHandler(int)
^~~~~~~~~~~~~
sha_simd.cpp:70:17: warning: ‘void CryptoPP::SigIllHandler(int)’ defined but not used [-Wunused-function]
static void SigIllHandler(int)
^~~~~~~~~~~~~
simon128_simd.cpp:367:9: warning: ‘__m128i {anonymous}::RotateRight64(const __m128i&) [with unsigned int R = 8]’ defined but not used [-Wunused-function]
__m128i RotateRight64<8>(const __m128i& val)
^~~~~~~~~~~~~~~~
simon64_simd.cpp:345:9: warning: ‘__m128i {anonymous}::RotateRight32(const __m128i&) [with unsigned int R = 8]’ defined but not used [-Wunused-function]
__m128i RotateRight32<8>(const __m128i& val)
^~~~~~~~~~~~~~~~
sse_simd.cpp:45:17: warning: ‘void CryptoPP::SigIllHandlerSSE2(int)’ defined but not used [-Wunused-function]
static void SigIllHandlerSSE2(int)
^~~~~~~~~~~~~~~~~ |
Given a test file with just
gcc -Wall
will printBut if I add
No waning is printed. This is because of the following in
cryptopp/config.h
.The text was updated successfully, but these errors were encountered: