Skip to content

Commit 353415c

Browse files
rigtorpErik Rigtorp
authored andcommitted
Ignore -Wtype-limits on range check
1 parent f6b4b75 commit 353415c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppGenerator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,13 @@ private static void generateGroupClassHeader(
235235
indent + " inline void wrapForEncode(char *buffer, const %3$s count," +
236236
" std::uint64_t *pos, const std::uint64_t actingVersion, const std::uint64_t bufferLength)\n" +
237237
indent + " {\n" +
238+
indent + "#pragma GCC diagnostic push\n" +
239+
indent + "#pragma GCC diagnostic ignored \"-Wtype-limits\"\n" +
238240
indent + " if (count < %5$d || count > %6$d)\n" +
239241
indent + " {\n" +
240242
indent + " throw std::runtime_error(\"count outside of allowed range [E110]\");\n" +
241243
indent + " }\n" +
244+
indent + "#pragma GCC diagnostic pop\n" +
242245
indent + " m_buffer = buffer;\n" +
243246
indent + " m_bufferLength = bufferLength;\n" +
244247
indent + " m_dimensions.wrap(m_buffer, *pos, actingVersion, bufferLength);\n" +
@@ -314,8 +317,7 @@ private static void generateGroupClassHeader(
314317
indent + " next(); func(*this);\n" +
315318
indent + " }\n" +
316319
indent + " }\n\n" +
317-
indent + "#endif\n\n",
318-
formatClassName(groupName)));
320+
indent + "#endif\n\n"));
319321
}
320322

321323
private static CharSequence generateGroupProperty(

0 commit comments

Comments
 (0)