adrian-thurston / ragel

Ragel State Machine Compiler
MIT License
532 stars 46 forks source link

common: Fix ambiguous CHAR_MIN/MAX definition #52

Closed JunHe77 closed 4 years ago

JunHe77 commented 4 years ago

According to C/C++ standards, char is implementation-defined whether it could hold negative values. See: http://www.cplusplus.com/reference/climits/ In ragel char is treated as a signed value with range as [-128, 127]. This means that the CHAR_MIN/CHAR_MAX should be replaced with a more accurate definition to align across different systems and library implementations.

Change-Id: I10668f2d2550b603101dc68f4cc1121035022abd Signed-off-by: Jun He jun.he@linaro.org