| 1 | = The problem with integer types = |
| 2 | |
| 3 | C defines integer types `int`, `long`, `short`, `char`, `signed` or `unsigned`. |
| 4 | |
| 5 | These types raise numerous problems in portable code: |
| 6 | * They change size from one arch/cpu to another |
| 7 | * There is no integer type which does the size of a pointer |
| 8 | |
| 9 | = C99 Types = |
| 10 | |
| 11 | C99 defines portable fixed-size types: |
| 12 | |
| 13 | `[u]intXX_t` where `u` is present if unsigned, and `XX` is the size in bits. `XX` can range from 8 to 64, and is power of 2. |
| 14 | |
| 15 | Moreover, C99 defines: |
| 16 | * `[u]intptr_t`, which is the size of an address, thus can contain a pointer |
| 17 | * `[u]int_fastXX_t`, which are '''at least''' XX bits long, but may be larger if the larger implementation is cheaper |
| 18 | |
| 19 | = C types in MutekH = |
| 20 | |
| 21 | Using legacy integer types in MutekH's core code is not wanted. |
| 22 | |
| 23 | Default settings in configuration of the build system makes the legacy types emit a warning, or even dont compile at all. |
| 24 | |
| 25 | Sometimes, because you are using huge amounts of code that |
| 26 | must be used without a complete rewrite, you may want to disable this |
| 27 | limitation adding the following line in the configuration file: |
| 28 | {{{ |
| 29 | CONFIG_HEXO_INTTYPES_DEPRECATED undefined |
| 30 | }}} |