szaszm commented on code in PR #2174: URL: https://github.com/apache/nifi-minifi-cpp/pull/2174#discussion_r3281955145
########## CMakeLists.txt: ########## @@ -302,7 +301,14 @@ include(GslLite) # Add necessary definitions based on the value of STRICT_GSL_CHECKS, see gsl-lite README for more details list(APPEND GslDefinitions gsl_CONFIG_DEFAULTS_VERSION=1) -list(APPEND GslDefinitionsNonStrict gsl_CONFIG_CONTRACT_VIOLATION_THROWS gsl_CONFIG_NARROW_THROWS_ON_TRUNCATION=1) +list(APPEND GslDefinitions gsl_FEATURE_BYTE=1) +list(APPEND GslDefinitions gsl_CONFIG_NARROW_THROWS_ON_TRUNCATION=1) Review Comment: gsl_CONFIG_NARROW_THROWS_ON_TRUNCATION: If we wanted to keep the old behavior, it would need to be 1 in non-strict/release mode and 0 in normal mode. But we can also reevaluate this behavior. Back when we introduced gsl-lite, narrow truncation was treated as any other contract check failure, but today the C++ Core Guidelines specifies that narrow throws on truncation. I think we can change the behavior of narrow to match modern guidelines and leave this setting on default. gsl_FEATURE_BYTE: why do we already set it to 1 manually? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
