[PATCH 03 of 11] Core: changed ngx_buf_tag_t to uintptr_t

Maxim Dounin mdounin at mdounin.ru
Wed Aug 7 01:03:48 UTC 2024


# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1722992186 -10800
#      Wed Aug 07 03:56:26 2024 +0300
# Node ID ebebc1d680464f36a8a305443f1207965338bca3
# Parent  92e14ce71b72be32a4369eeeab618cc77e2723c5
Core: changed ngx_buf_tag_t to uintptr_t.

There is no real difference, but "void *" as previously used results
in "ISO C forbids conversion of function pointer to object pointer type"
warnings with -Wpedantic when a function pointer is used as a tag.

Changing the type to uintptr_t makes the conversion always valid, since
any pointer type can be converted to an integer type.

diff --git a/src/core/ngx_buf.h b/src/core/ngx_buf.h
--- a/src/core/ngx_buf.h
+++ b/src/core/ngx_buf.h
@@ -13,7 +13,7 @@
 #include <ngx_core.h>
 
 
-typedef void *            ngx_buf_tag_t;
+typedef uintptr_t         ngx_buf_tag_t;
 
 typedef struct ngx_buf_s  ngx_buf_t;
 



More information about the nginx-devel mailing list