diff options
author | Jeff King <peff@peff.net> | 2017-09-06 08:32:10 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-07 09:41:14 +0900 |
commit | c1bb33c99c3a35012f7242b1d83b04233057555c (patch) | |
tree | 1347b9892a2ac2e9ee0d9f2f8c92bde56bc41c88 /t | |
parent | system_path: move RUNTIME_PREFIX to a sub-function (diff) | |
download | tgif-c1bb33c99c3a35012f7242b1d83b04233057555c.tar.xz |
git_extract_argv0_path: do nothing without RUNTIME_PREFIX
When the RUNTIME_PREFIX compile-time knob isn't set, we
never look at the argv0_path we extract. We can push its
declaration inside the #ifdef to make it more clear that the
extract code is effectively a noop.
This also un-confuses leak-checking of the argv0_path
variable when RUNTIME_PREFIX isn't set. The compiler is free
to drop this static variable that we set but never look at
(and "gcc -O2" does so). But the compiler still must call
strbuf_detach(), since it doesn't know whether that function
has side effects; it just throws away the result rather than
putting it into the global.
Leak-checkers which work by scanning the data segment for
pointers to heap blocks would normally consider the block
as reachable at program end. But if the compiler removes the
variable entirely, there's nothing to find.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
0 files changed, 0 insertions, 0 deletions