pboettch / json-schema-validator

JSON schema validator for JSON for Modern C++
Other
466 stars 134 forks source link

Fix assumed signed char #242

Closed bobolopolis closed 1 year ago

bobolopolis commented 1 year ago

The code assumes that char is signed, but whether char is signed or unsigned is implementation defined. On some architectures like PowerPC, GCC treats char as unsigned resulting in compile errors:

smtp-address-validator.cpp:213:1: error: narrowing conversion of '-32' from 'int' to 'char' [-Wnarrowing]

Fix this by specifying signed char.

garethsb commented 1 year ago

This (122 errors) also occurs on my GCC 9.4 build on linux/arm64, so thanks for the fix.