diff options
author | Jun He <jun.he@linaro.org> | 2020-09-17 14:03:09 +0800 |
---|---|---|
committer | Jun He <jun.he@linaro.org> | 2020-09-17 14:32:22 +0800 |
commit | e2650a71a1af9711fd07e213988db4b3c6d7fa71 (patch) | |
tree | 4c31853b5855a1e37bce79c7656e60e870a04bbb /src/host-d/main.cc | |
parent | 401cb0041f5871215d83c64ab5e021149078e426 (diff) | |
download | ragel-e2650a71a1af9711fd07e213988db4b3c6d7fa71.tar.gz |
common: Fix ambiguous CHAR_MIN/MAX definition
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>
Diffstat (limited to 'src/host-d/main.cc')
-rw-r--r-- | src/host-d/main.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/host-d/main.cc b/src/host-d/main.cc index f6eb7cbe..6841f2e9 100644 --- a/src/host-d/main.cc +++ b/src/host-d/main.cc @@ -40,7 +40,7 @@ const char *defaultOutFnD( const char *inputFileName ) HostType hostTypesD[] = { - { "byte", 0, "byte", true, true, false, CHAR_MIN, CHAR_MAX, 0, 0, 1 }, + { "byte", 0, "byte", true, true, false, SCHAR_MIN, SCHAR_MAX, 0, 0, 1 }, { "ubyte", 0, "ubyte", false, true, false, 0, 0, 0, UCHAR_MAX, 1 }, { "char", 0, "char", false, true, false, 0, 0, 0, UCHAR_MAX, 1 }, { "short", 0, "short", true, true, false, SHRT_MIN, SHRT_MAX, 0, 0, 2 }, |