{"thread":{"id":"46722","subject":"[PATCH] usage: conditionally compile unleak_memory() definition","startedAt":"2017-09-07T16:08:34Z","lastAt":"2017-09-08T03:37:45Z","messageCount":2,"participants":["Ramsay Jones","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"327714","messageId":"1cf112f5-aad1-e1c6-b507-9524f4b72fec@ramsayjones.plus.com","threadId":"46722","inReplyTo":null,"subject":"[PATCH] usage: conditionally compile unleak_memory() definition","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2017-09-07T16:08:23Z","receivedAt":"2017-09-07T16:08:34Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n\nHi Jeff,\n\nIf you need to re-roll your 'jk/leak-checkers' branch, could you\nplease squash this into the relevant patch (commit c57586d954,\n\"add UNLEAK annotation for reducing leak false positives\", 05-09-2017).\n\nThis was noticed by sparse, since it is not declared when the\nSUPPRESS_ANNOTATED_LEAKS pre-processor macro is not defined.\n(You could move the declaration out of the #ifdef in the header\nfile, I suppose, but it seems pointless to compile the function\nif it isn't being used).\n\nThanks!\n\nATB,\nRamsay Jones\n\n usage.c | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/usage.c b/usage.c\nindex 780ed73be..cdd534c9d 100644\n--- a/usage.c\n+++ b/usage.c\n@@ -242,6 +242,7 @@ NORETURN void BUG(const char *fmt, ...)\n }\n #endif\n \n+#ifdef SUPPRESS_ANNOTATED_LEAKS\n void unleak_memory(const void *ptr, size_t len)\n {\n \tstatic struct suppressed_leak_root {\n@@ -254,3 +255,4 @@ void unleak_memory(const void *ptr, size_t len)\n \troot->next = suppressed_leaks;\n \tsuppressed_leaks = root;\n }\n+#endif\n-- \n2.14.0\n"},{"id":"327745","messageId":"20170908033733.r3c2akrtbk5wvqad@sigill.intra.peff.net","threadId":"46722","inReplyTo":"1cf112f5-aad1-e1c6-b507-9524f4b72fec@ramsayjones.plus.com","subject":"Re: [PATCH] usage: conditionally compile unleak_memory() definition","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-09-08T03:37:34Z","receivedAt":"2017-09-08T03:37:45Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Sep 07, 2017 at 05:08:23PM +0100, Ramsay Jones wrote:\n\n> Hi Jeff,\n> \n> If you need to re-roll your 'jk/leak-checkers' branch, could you\n> please squash this into the relevant patch (commit c57586d954,\n> \"add UNLEAK annotation for reducing leak false positives\", 05-09-2017).\n> \n> This was noticed by sparse, since it is not declared when the\n> SUPPRESS_ANNOTATED_LEAKS pre-processor macro is not defined.\n> (You could move the declaration out of the #ifdef in the header\n> file, I suppose, but it seems pointless to compile the function\n> if it isn't being used).\n\nThanks, that makes sense. There are a handful of other bits to modify in\nthat final commit, so I will end up with at least one re-roll.\n\n-Peff\n"}]}