changeset 9420:666b706a30b3

Use NGX_CONF_OK in some function return checks. The functions ngx_http_merge_types() & ngx_conf_merge_path_value() return either NGX_CONF_OK aka NULL aka ((void *)0) (probably) or NGX_CONF_ERROR aka ((void *)-1). They don't return an integer constant which is what NGX_OK aka (0) is. Lets use the right thing in the function return check. This was found with -Wzero-as-null-pointer-constant which was enabled for C in GCC 15 (not enabled with Wall or Wextra... yet). Link: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117059>
author Andrew Clayton <a.clayton@nginx.com>
date Wed, 21 May 2025 22:19:32 +0100
parents 8c6978316ea4
children 927f43435c0a
files src/http/modules/ngx_http_addition_filter_module.c src/http/modules/ngx_http_charset_filter_module.c src/http/modules/ngx_http_fastcgi_module.c src/http/modules/ngx_http_gzip_filter_module.c src/http/modules/ngx_http_proxy_module.c src/http/modules/ngx_http_scgi_module.c src/http/modules/ngx_http_ssi_filter_module.c src/http/modules/ngx_http_sub_filter_module.c src/http/modules/ngx_http_uwsgi_module.c src/http/modules/ngx_http_xslt_filter_module.c src/http/ngx_http_core_module.c
diffstat 11 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/modules/ngx_http_addition_filter_module.c	Fri Jun 20 18:46:17 2025 +0400
+++ b/src/http/modules/ngx_http_addition_filter_module.c	Wed May 21 22:19:32 2025 +0100
@@ -245,7 +245,7 @@
     if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types,
                              &prev->types_keys, &prev->types,
                              ngx_http_html_default_types)
-        != NGX_OK)
+        != NGX_CONF_OK)
     {
         return NGX_CONF_ERROR;
     }
--- a/src/http/modules/ngx_http_charset_filter_module.c	Fri Jun 20 18:46:17 2025 +0400
+++ b/src/http/modules/ngx_http_charset_filter_module.c	Wed May 21 22:19:32 2025 +0100
@@ -1564,7 +1564,7 @@
     if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types,
                              &prev->types_keys, &prev->types,
                              ngx_http_charset_default_types)
-        != NGX_OK)
+        != NGX_CONF_OK)
     {
         return NGX_CONF_ERROR;
     }
--- a/src/http/modules/ngx_http_fastcgi_module.c	Fri Jun 20 18:46:17 2025 +0400
+++ b/src/http/modules/ngx_http_fastcgi_module.c	Wed May 21 22:19:32 2025 +0100
@@ -3130,7 +3130,7 @@
     if (ngx_conf_merge_path_value(cf, &conf->upstream.temp_path,
                               prev->upstream.temp_path,
                               &ngx_http_fastcgi_temp_path)
-        != NGX_OK)
+        != NGX_CONF_OK)
     {
         return NGX_CONF_ERROR;
     }
--- a/src/http/modules/ngx_http_gzip_filter_module.c	Fri Jun 20 18:46:17 2025 +0400
+++ b/src/http/modules/ngx_http_gzip_filter_module.c	Wed May 21 22:19:32 2025 +0100
@@ -1115,7 +1115,7 @@
     if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types,
                              &prev->types_keys, &prev->types,
                              ngx_http_html_default_types)
-        != NGX_OK)
+        != NGX_CONF_OK)
     {
         return NGX_CONF_ERROR;
     }
--- a/src/http/modules/ngx_http_proxy_module.c	Fri Jun 20 18:46:17 2025 +0400
+++ b/src/http/modules/ngx_http_proxy_module.c	Wed May 21 22:19:32 2025 +0100
@@ -3859,7 +3859,7 @@
     if (ngx_conf_merge_path_value(cf, &conf->upstream.temp_path,
                               prev->upstream.temp_path,
                               &ngx_http_proxy_temp_path)
-        != NGX_OK)
+        != NGX_CONF_OK)
     {
         return NGX_CONF_ERROR;
     }
--- a/src/http/modules/ngx_http_scgi_module.c	Fri Jun 20 18:46:17 2025 +0400
+++ b/src/http/modules/ngx_http_scgi_module.c	Wed May 21 22:19:32 2025 +0100
@@ -1543,7 +1543,7 @@
     if (ngx_conf_merge_path_value(cf, &conf->upstream.temp_path,
                                   prev->upstream.temp_path,
                                   &ngx_http_scgi_temp_path)
-        != NGX_OK)
+        != NGX_CONF_OK)
     {
         return NGX_CONF_ERROR;
     }
--- a/src/http/modules/ngx_http_ssi_filter_module.c	Fri Jun 20 18:46:17 2025 +0400
+++ b/src/http/modules/ngx_http_ssi_filter_module.c	Wed May 21 22:19:32 2025 +0100
@@ -2942,7 +2942,7 @@
     if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types,
                              &prev->types_keys, &prev->types,
                              ngx_http_html_default_types)
-        != NGX_OK)
+        != NGX_CONF_OK)
     {
         return NGX_CONF_ERROR;
     }
--- a/src/http/modules/ngx_http_sub_filter_module.c	Fri Jun 20 18:46:17 2025 +0400
+++ b/src/http/modules/ngx_http_sub_filter_module.c	Wed May 21 22:19:32 2025 +0100
@@ -901,7 +901,7 @@
     if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types,
                              &prev->types_keys, &prev->types,
                              ngx_http_html_default_types)
-        != NGX_OK)
+        != NGX_CONF_OK)
     {
         return NGX_CONF_ERROR;
     }
--- a/src/http/modules/ngx_http_uwsgi_module.c	Fri Jun 20 18:46:17 2025 +0400
+++ b/src/http/modules/ngx_http_uwsgi_module.c	Wed May 21 22:19:32 2025 +0100
@@ -1803,7 +1803,7 @@
     if (ngx_conf_merge_path_value(cf, &conf->upstream.temp_path,
                                   prev->upstream.temp_path,
                                   &ngx_http_uwsgi_temp_path)
-        != NGX_OK)
+        != NGX_CONF_OK)
     {
         return NGX_CONF_ERROR;
     }
--- a/src/http/modules/ngx_http_xslt_filter_module.c	Fri Jun 20 18:46:17 2025 +0400
+++ b/src/http/modules/ngx_http_xslt_filter_module.c	Wed May 21 22:19:32 2025 +0100
@@ -1112,7 +1112,7 @@
     if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types,
                              &prev->types_keys, &prev->types,
                              ngx_http_xslt_default_types)
-        != NGX_OK)
+        != NGX_CONF_OK)
     {
         return NGX_CONF_ERROR;
     }
--- a/src/http/ngx_http_core_module.c	Fri Jun 20 18:46:17 2025 +0400
+++ b/src/http/ngx_http_core_module.c	Wed May 21 22:19:32 2025 +0100
@@ -3931,7 +3931,7 @@
     if (ngx_conf_merge_path_value(cf, &conf->client_body_temp_path,
                               prev->client_body_temp_path,
                               &ngx_http_client_temp_path)
-        != NGX_OK)
+        != NGX_CONF_OK)
     {
         return NGX_CONF_ERROR;
     }