• Tommaso Tocci's avatar
    Avoid optimization for readdir/opendir · f16b7a2b
    Tommaso Tocci authored
    In the glibc both readdir and closedir functions marks the @dirp parameter
    with a non-null attribute.
    If we use a compiler optimization level grater then 1,
    the `dirp == nullptr` expression is evaluated to false
    at compilation time and the relative if blocks is cutted out
    of the final binary.
    
    In order to avoid this bheaviour, we implement a functions and then set
    that as weak alias of the real glibc function call.
    f16b7a2b