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

Maxim Dounin mdounin at mdounin.ru
Thu Jul 7 13:55:28 UTC 2016


Hello!

On Mon, Jun 27, 2016 at 03:59:20PM -0700, Piotr Sikora wrote:

> # HG changeset patch
> # User Piotr Sikora <piotrsikora at google.com>
> # Date 1467064804 25200
> #      Mon Jun 27 15:00:04 2016 -0700
> # Node ID 2c14d7fb1d96c3a1bfb7e22383bef895287bf7d7
> # Parent  d452cb27639f714bc43b7f3ede417e3e7f8efdd6
> Configure: fix build with -Werror=nonnull.
> 
> Signed-off-by: Piotr Sikora <piotrsikora at google.com>
> 
> diff -r d452cb27639f -r 2c14d7fb1d96 auto/unix
> --- a/auto/unix
> +++ b/auto/unix
> @@ -260,7 +260,8 @@ ngx_feature_run=no
>  ngx_feature_incs="#include <dlfcn.h>"
>  ngx_feature_path=
>  ngx_feature_libs=
> -ngx_feature_test="dlopen(NULL, RTLD_NOW | RTLD_GLOBAL); dlsym(NULL, NULL)"
> +ngx_feature_test="dlopen(\"/dev/null\", RTLD_NOW | RTLD_GLOBAL);
> +                  dlsym(NULL, \"dummy\")"
>  . auto/feature

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.

Committed with the above modification, thanks.
http://hg.nginx.org/nginx/rev/0bf08d9c82c1

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx-devel mailing list