branches with status:
Name Status Last Modified Last Commit
lp://staging/~steinhardtp/apparmor/musl (Has a merge proposal) 1 Development 2017-09-27 09:51:57 UTC
3713. parser: explicitly define non-standar...

Author: Patrick Steinhardt
Revision Date: 2017-09-27 09:44:36 UTC

parser: explicitly define non-standard function types

In our parser code, we use the function definitions
`comparison_fn_t` and `__free_fn_t` to cast function pointers to
the correct type. These typedefs are not standardized though and
are specific to the glibc library, which may cause compiler
errors when another libc is being used instead.

To fix the issue we can add explicit typedefs for those
functions. Having duplicated typedefs is not an issue as long as
the actual type alias is the same for all existing typedefs of
the same name. Given that both the comparison function and the
free function have a standardized function signature, this is not
an issue.

This fixes compilation with musl libc.

Signed-off-by: Patrick Steinhardt <ps@pks.im>

11 of 1 result