Use portable types in the C/C++ code generatorragel-6
commitdc238e78cd3024889b6fb2618fe5bbc20179a132
authorJan Kundrát <jkt@flaska.net>
Wed, 18 Sep 2013 13:34:24 +0000 (18 15:34 +0200)
committerJan Kundrát <jkt@flaska.net>
Wed, 18 Sep 2013 13:38:51 +0000 (18 15:38 +0200)
tree5b82c8898cd94577bc52401647441a7fc9a8a6b0
parentc1d4588d691d443bcfc327471bfb6df01fed8b9e
Use portable types in the C/C++ code generator

C++11 brought new narrowing rules which, among other things, prohibit saving -1
or -128 into a char when the platform's char is actually unsigned. This causes
troubles when cross-compiling from e.g. amd64 to ARM.

This patch makes sure that the host and target both use the same types with the
equivalent range of storable values. Note that we cannot use the int_fast*_t
types because their size actually differs between platforms, and this size
appears to be used in ragel's code for explicit over/underflow checking.
ragel/common.cpp