Skip to content
Snippets Groups Projects
  • Vladimír Čunát's avatar
    e2972723
    lib/generic/array: fix a strict aliasing problem · e2972723
    Vladimír Čunát authored
    The issue here is that `char *` is not allowed to alias
    with `anyType *`.  With gcc-10 in Fedora this now started
    to cause real problems and loading stats module segfaulted.
    
    Actually I can't see in standard (C11 6.5 par.7) that using `void *`
    is guaranteed to be correct, but at least it seems fine with gcc,
    and e.g. some standard functions like posix_memalign() use it
    in the same "dangerous" way.
    e2972723
    History
    lib/generic/array: fix a strict aliasing problem
    Vladimír Čunát authored
    The issue here is that `char *` is not allowed to alias
    with `anyType *`.  With gcc-10 in Fedora this now started
    to cause real problems and loading stats module segfaulted.
    
    Actually I can't see in standard (C11 6.5 par.7) that using `void *`
    is guaranteed to be correct, but at least it seems fine with gcc,
    and e.g. some standard functions like posix_memalign() use it
    in the same "dangerous" way.
To find the state of this project's repository at the time of any of these versions, check out the tags.