summaryrefslogtreecommitdiff
path: root/grep.h
diff options
context:
space:
mode:
authorMax Horn <max@quendi.de>2013-01-16 18:09:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-01-16 20:47:46 (GMT)
commit5ded807f7c0be10ecbb31555e5d10dee553752d6 (patch)
tree4a102e5f0d148fe587cedef9fe9eaa2b4120001e /grep.h
parenta469a1019352b8efc4bd7003b0bd59eb60fc428c (diff)
downloadgit-5ded807f7c0be10ecbb31555e5d10dee553752d6.zip
git-5ded807f7c0be10ecbb31555e5d10dee553752d6.tar.gz
git-5ded807f7c0be10ecbb31555e5d10dee553752d6.tar.bz2
fix clang -Wunused-value warnings for error functions
Commit a469a10 wraps some error calls in macros to give the compiler a chance to do more static analysis on their constant -1 return value. We limit the use of these macros to __GNUC__, since gcc is the primary beneficiary of the new information, and because we use GNU features for handling variadic macros. However, clang also defines __GNUC__, but generates warnings with -Wunused-value when these macros are used in a void context, because the constant "-1" ends up being useless. Gcc does not complain about this case (though it is unclear if it is because it is smart enough to see what we are doing, or too dumb to realize that the -1 is unused). We can squelch the warning by just disabling these macros when clang is in use. Signed-off-by: Max Horn <max@quendi.de> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.h')
0 files changed, 0 insertions, 0 deletions