* [PATCH] fast-import: fix a sparse 'NULL pointer' warning
@ 2018-03-30 22:22 Ramsay Jones
2018-03-30 22:26 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Ramsay Jones @ 2018-03-30 22:22 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jameson Miller, GIT Mailing-list
Commit a8dfa11562 ("fast-import: introduce mem_pool type", 2018-03-26)
introduces a 'mem_pool' type, along with a file-local global symbol
('fi_mem_poll') which is initialised in its declaration. This causes
sparse to issue a warning, thus:
SP fast-import.c
fast-import.c:301:40: warning: Using plain integer as NULL pointer
In order to suppress the warning, replace the '0' used to initialise the
'mp_block' field (of type 'struct mp_block *') with NULL.
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
Hi Junio,
This was going to be an email to Jameson, but I wasn't fast enough! :(
This was originally written against the 'pu' branch, but since the
'jm/mem-pool' branch has graduated to 'next', I have rebased on 'next'.
Perhaps this could be squashed into that branch when you re-build
the 'next' branch at the beginning of the next cycle?
ATB,
Ramsay Jones
fast-import.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fast-import.c b/fast-import.c
index 0aa148ea4..38356e293 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -298,7 +298,7 @@ static int global_argc;
static const char **global_argv;
/* Memory pools */
-static struct mem_pool fi_mem_pool = {0, 2*1024*1024 - sizeof(struct mp_block), 0 };
+static struct mem_pool fi_mem_pool = {NULL, 2*1024*1024 - sizeof(struct mp_block), 0 };
/* Atom management */
static unsigned int atom_table_sz = 4451;
--
2.16.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fast-import: fix a sparse 'NULL pointer' warning
2018-03-30 22:22 [PATCH] fast-import: fix a sparse 'NULL pointer' warning Ramsay Jones
@ 2018-03-30 22:26 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2018-03-30 22:26 UTC (permalink / raw)
To: Ramsay Jones; +Cc: Jameson Miller, GIT Mailing-list
Ramsay Jones <ramsay@ramsayjones.plus.com> writes:
> This was going to be an email to Jameson, but I wasn't fast enough! :(
>
> This was originally written against the 'pu' branch, but since the
> 'jm/mem-pool' branch has graduated to 'next', I have rebased on 'next'.
>
> Perhaps this could be squashed into that branch when you re-build
> the 'next' branch at the beginning of the next cycle?
Thanks.
Yes, that would be the most sensible thing to do, I would think, as
the topic itself (like many other branches that are merged to 'next'
during the pre-release feature freeze period) is not ready for the
'master' branch yet anyway.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-30 22:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-30 22:22 [PATCH] fast-import: fix a sparse 'NULL pointer' warning Ramsay Jones
2018-03-30 22:26 ` Junio C Hamano
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).