https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91187

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Albert Astals Cid from comment #0)
> #define Z_NULL 0

N.B. this is actually a bug. Using Z_NULL where a null pointer is expected
might cause bugs e.g. execl("foo", "foo", Z_NULL) can pass a 32-bit int where a
64-bit pointer is expected, leading to undefined behaviour.

So maybe the warning should be taken as an opportunity to fix the code (or
report a bug to the library) to use something safer:

#if __cplusplus
#define Z_NULL nullptr
#else
#define Z_NULL 0L
#endif

Reply via email to