diff options
| author | Andrew Clayton <a.clayton@nginx.com> | 2025-05-21 04:13:11 +0100 |
|---|---|---|
| committer | Andrew Clayton <a.clayton@nginx.com> | 2025-05-28 16:35:34 +0100 |
| commit | 39f9121339559738cba5130c818e8920e1a2fa16 (patch) | |
| tree | 47a9fa136b6e5c127fb6779e6d94de0f13ce5fcd /src/nxt_unit.c | |
| parent | 4fcbe9caf6639fa0fb5ca1663a5f32527b522580 (diff) | |
| download | unit-39f9121339559738cba5130c818e8920e1a2fa16.tar.gz unit-39f9121339559738cba5130c818e8920e1a2fa16.tar.bz2 | |
Use NULL instead of 0 as null pointer constant
GCC 15 enabled "-Wzero-as-null-pointer-constant" for C, which checks for
places where '0' has been used as a null pointer constant.
This showed a few places in Unit where we were using '0' instead of the
more correct NULL macro. E.g.
$ make -j4 EXTRA_CFLAGS=-Wzero-as-null-pointer-constant
...
src/nxt_buf.c: In function ‘nxt_buf_mmap_alloc’:
src/nxt_buf.h:192:21: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
192 | (bm)->start = 0; \
| ^
src/nxt_buf.c:135:9: note: in expansion of macro ‘nxt_buf_mem_set_size’
135 | nxt_buf_mem_set_size(&b->mem, size);
| ^~~~~~~~~~~~~~~~~~~~
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'src/nxt_unit.c')
| -rw-r--r-- | src/nxt_unit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nxt_unit.c b/src/nxt_unit.c index 2f399678..7d523beb 100644 --- a/src/nxt_unit.c +++ b/src/nxt_unit.c @@ -716,7 +716,7 @@ nxt_unit_ctx_init(nxt_unit_impl_t *lib, nxt_unit_ctx_impl_t *ctx_impl, ctx_impl->req.req.unit = &lib->unit; ctx_impl->read_port = NULL; - ctx_impl->requests.slot = 0; + ctx_impl->requests.slot = NULL; return NXT_UNIT_OK; } |
