mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
Silence most -Wzero-as-null-pointer-constant diagnostics
Replace 0 by NULL and {0} by {}.
Omit a few cases that aren't so trivial to fix.
Link: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117059>
Link: <https://software.codidact.com/posts/292718/292759#answer-292759>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Adhemerval Zanella
parent
83d4b42ded
commit
53fcdf5f74
@@ -34,7 +34,7 @@ static void *alloc_ptr, *alloc_end, *alloc_last_block;
|
||||
void *
|
||||
__minimal_malloc (size_t n)
|
||||
{
|
||||
if (alloc_end == 0)
|
||||
if (alloc_end == NULL)
|
||||
{
|
||||
/* Consume any unused space in the last page of our data segment. */
|
||||
extern int _end attribute_hidden;
|
||||
@@ -57,7 +57,7 @@ __minimal_malloc (size_t n)
|
||||
if (__glibc_unlikely (nup == 0 && n != 0))
|
||||
return NULL;
|
||||
nup += GLRO(dl_pagesize);
|
||||
page = __mmap (0, nup, PROT_READ|PROT_WRITE,
|
||||
page = __mmap (NULL, nup, PROT_READ|PROT_WRITE,
|
||||
MAP_ANON|MAP_PRIVATE, -1, 0);
|
||||
if (page == MAP_FAILED)
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user