Ask Your Question

Revision history [back]

The problem is the ambiguity of the char datatype. On x86 gcc it defaults to signed, on ARM to unsigned. This results in negative values getting flipped.

See here:

and here:

one solution is to simply compile with the -fsigned-char switch, forcing all chars to be signed

## Compiler flags
    ## signed char is default on x86 gcc, not on arm however.
    set(CMAKE_CXX_FLAGS "-fsigned-char")