Avoid optimization for readdir/opendir
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.
parent
e9cb2605
Please register or sign in to comment