Permalink
Browse files

fixes #4703: fix erroneous warnings of gcc < 5 by using pragmas

  • Loading branch information...
Forgon2100
Forgon2100 committed Jan 11, 2018
1 parent 6a2a870 commit 21ca83b87c4d032326f582158d3a51898fb2a91f
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/framework/crc.cpp
View
@@ -328,12 +328,20 @@ class ecPrivateKeyDERExternalRepresentation {
return curveData_secp256r1();
default:
debug(LOG_FATAL, "Unimplemented curve ID");
#pragma GCC diagnostic push
// for gcc < 5 bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55805
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
return ecCurveData { };
#pragma GCC diagnostic pop
}
}
static ecCurveData curveData_secp224r1()
{
#pragma GCC diagnostic push
// for gcc < 5 bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55805
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
ecCurveData data = { };
#pragma GCC diagnostic pop
data.curveID = secp224r1;
data.prelude = wz_secp_privateKey_format::secp224r1::prelude;
data.prelude_len = sizeof(wz_secp_privateKey_format::secp224r1::prelude);
@@ -347,7 +355,11 @@ class ecPrivateKeyDERExternalRepresentation {
}
static ecCurveData curveData_secp256r1()
{
#pragma GCC diagnostic push
// for gcc < 5 bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55805
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
ecCurveData data = { };
#pragma GCC diagnostic pop
data.curveID = secp256r1;
data.prelude = wz_secp_privateKey_format::secp256r1::prelude;
data.prelude_len = sizeof(wz_secp_privateKey_format::secp256r1::prelude);

0 comments on commit 21ca83b

Please sign in to comment.