Verified Commit f16b7a2b authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment