I just started working on a big project which is supposed to be platform independent, but it actually uses types which are implementation defined such as char
.
This had already caused some problems, since for some devices char
is by default signed
while for others unsigned
.
I would like to find a solution in order to avoid the use of implementation defined types in code that must be platform independent.
- What would be the best solution? Re-defining all the char variables as
unsigned char
(orsigned char
), using compiler parameters (ex: -funsigned-char),typedef
s, or others? - Are there other types for which the standard does not define if they are either signed or unsigned?