git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] usage: conditionally compile unleak_memory() definition
@ 2017-09-07 16:08 Ramsay Jones
  2017-09-08  3:37 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Ramsay Jones @ 2017-09-07 16:08 UTC (permalink / raw)
  To: Jeff King; +Cc: Junio C Hamano, GIT Mailing-list


Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---

Hi Jeff,

If you need to re-roll your 'jk/leak-checkers' branch, could you
please squash this into the relevant patch (commit c57586d954,
"add UNLEAK annotation for reducing leak false positives", 05-09-2017).

This was noticed by sparse, since it is not declared when the
SUPPRESS_ANNOTATED_LEAKS pre-processor macro is not defined.
(You could move the declaration out of the #ifdef in the header
file, I suppose, but it seems pointless to compile the function
if it isn't being used).

Thanks!

ATB,
Ramsay Jones

 usage.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/usage.c b/usage.c
index 780ed73be..cdd534c9d 100644
--- a/usage.c
+++ b/usage.c
@@ -242,6 +242,7 @@ NORETURN void BUG(const char *fmt, ...)
 }
 #endif
 
+#ifdef SUPPRESS_ANNOTATED_LEAKS
 void unleak_memory(const void *ptr, size_t len)
 {
 	static struct suppressed_leak_root {
@@ -254,3 +255,4 @@ void unleak_memory(const void *ptr, size_t len)
 	root->next = suppressed_leaks;
 	suppressed_leaks = root;
 }
+#endif
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usage: conditionally compile unleak_memory() definition
  2017-09-07 16:08 [PATCH] usage: conditionally compile unleak_memory() definition Ramsay Jones
@ 2017-09-08  3:37 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2017-09-08  3:37 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: Junio C Hamano, GIT Mailing-list

On Thu, Sep 07, 2017 at 05:08:23PM +0100, Ramsay Jones wrote:

> Hi Jeff,
> 
> If you need to re-roll your 'jk/leak-checkers' branch, could you
> please squash this into the relevant patch (commit c57586d954,
> "add UNLEAK annotation for reducing leak false positives", 05-09-2017).
> 
> This was noticed by sparse, since it is not declared when the
> SUPPRESS_ANNOTATED_LEAKS pre-processor macro is not defined.
> (You could move the declaration out of the #ifdef in the header
> file, I suppose, but it seems pointless to compile the function
> if it isn't being used).

Thanks, that makes sense. There are a handful of other bits to modify in
that final commit, so I will end up with at least one re-roll.

-Peff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-08  3:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-07 16:08 [PATCH] usage: conditionally compile unleak_memory() definition Ramsay Jones
2017-09-08  3:37 ` Jeff King

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).