[PATCH] Configure: fix build with -Werror=nonnull

Piotr Sikora piotrsikora at google.com
Fri Jul 8 00:04:48 UTC 2016


Hey Maxim,

> First argument of dlopen() can be NULL,
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/dlopen.html:
>
> : If file is a null pointer, dlopen() shall return a global symbol
> : table handle for the currently running process image.
>
> Linux seems to use nonnull for the second argument of dlsym(),
> something like
>
> -ngx_feature_test="dlopen(NULL, RTLD_NOW | RTLD_GLOBAL); dlsym(NULL, NULL)"
> +ngx_feature_test="dlopen(NULL, RTLD_NOW | RTLD_GLOBAL); dlsym(NULL, \"\")"
>
> should be enough to silence the warning.

Weird, I was sure it was marked __nonnull for both arguments, but I
cannot replicate it now and your fix is indeed enough to silence the
warning.

Thanks for double-checking!

Best regards,
Piotr Sikora



More information about the nginx-devel mailing list