diff options
| author | ZyX <kp-pav@yandex.ru> | 2017-04-14 00:12:05 +0300 | 
|---|---|---|
| committer | ZyX <kp-pav@yandex.ru> | 2017-04-14 23:58:47 +0300 | 
| commit | b54e5c220f0b1bff31ce65c6988f70cbb9780b5e (patch) | |
| tree | caaaa79ac91dd6f8f8a32cde2e612ea311d34b12 /test/functional/eval/changedtick_spec.lua | |
| parent | 276ee1f7fb989b931a9ddfabfd4aaf1782bcbb77 (diff) | |
| download | rneovim-b54e5c220f0b1bff31ce65c6988f70cbb9780b5e.tar.gz rneovim-b54e5c220f0b1bff31ce65c6988f70cbb9780b5e.tar.bz2 rneovim-b54e5c220f0b1bff31ce65c6988f70cbb9780b5e.zip  | |
unittests: Add a test for TV_CSTRING
Not using enum{} because SIZE_MAX exceeds integer and I do not really like how
enum definition is described in C99:
1. Even though all values must fit into the chosen type (6.7.2.2, p 4) the type
   to choose is still implementation-defined.
2. 6.4.4.3 explicitly states that “an identifier declared as an enumeration
   constant has type `int`”. So it looks like “no matter what type was chosen
   for enumeration, constants will be integers”. Yet the following simple
   program:
        #include <stdint.h>
        #include <stdio.h>
        #include <stddef.h>
        enum { X=SIZE_MAX };
        int main(int argc, char **argv)
        {
          printf("x:%zu m:%zu t:%zu v:%zu",
                 sizeof(X), sizeof(SIZE_MAX), sizeof(size_t), (size_t)X);
        }
    yields one of the following using different compilers:
    - clang/gcc/pathcc: `x:8 m:8 t:8 v:18446744073709551615`
    - pcc/tcc: `x:4 m:8 t:8 v:1844674407370955161`
    If I remove the cast of X to size_t then pcc/tcc both yield `x:4 m:8 t:8
    v:4294967295`, other compilers’ output does not change.
    All compilers were called with `$compiler -std=c99 -xc -` (feeding program
    from echo), except for `tcc` which has missing `-std=c99`. `pcc` seems to
    ignore the argument though: it is perfectly fine with `-std=c1000`.
Diffstat (limited to 'test/functional/eval/changedtick_spec.lua')
0 files changed, 0 insertions, 0 deletions
