Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-02-12 23:41:36 +0300
committerJunio C Hamano <gitster@pobox.com>2020-02-12 23:41:36 +0300
commitb7833910180d7d762ad0bb0f59cb02ba9ef86710 (patch)
tree18808c68ce616bbed629e61b407817f29d926e42 /compat
parenta74c387495d1640537c5e163b053932ab1992156 (diff)
parentcf82bff73f11d3197aa6b667002ea86da1dfa835 (diff)
Merge branch 'jk/clang-sanitizer-fixes'
C pedantry ;-) fix. * jk/clang-sanitizer-fixes: obstack: avoid computing offsets from NULL pointer xdiff: avoid computing non-zero offset from NULL pointer avoid computing zero offsets from NULL pointer merge-recursive: use subtraction to flip stage merge-recursive: silence -Wxor-used-as-pow warning
Diffstat (limited to 'compat')
-rw-r--r--compat/obstack.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/compat/obstack.h b/compat/obstack.h
index 01e7c81840..f90a46d9b9 100644
--- a/compat/obstack.h
+++ b/compat/obstack.h
@@ -135,8 +135,10 @@ extern "C" {
alignment relative to 0. */
#define __PTR_ALIGN(B, P, A) \
- __BPTR_ALIGN (sizeof (PTR_INT_TYPE) < sizeof (void *) ? (B) : (char *) 0, \
- P, A)
+ (sizeof (PTR_INT_TYPE) < sizeof(void *) ? \
+ __BPTR_ALIGN((B), (P), (A)) : \
+ (void *)__BPTR_ALIGN((PTR_INT_TYPE)(void *)0, (PTR_INT_TYPE)(P), (A)) \
+ )
#include <string.h>