src: enable -Wzero-as-null-pointer-constant when using clang

This commit is contained in:
Markus F.X.J. Oberhumer
2022-08-20 10:51:08 +02:00
parent d001a63bce
commit 6931a3aa70
3 changed files with 13 additions and 10 deletions
+3 -3
View File
@@ -4822,7 +4822,7 @@ typedef unsigned short wchar_t;
#endif
#endif
#ifndef offsetof
#define offsetof(s,m) ((size_t)((ptrdiff_t)&(((s*)0)->m)))
#define offsetof(s,m) ((size_t)((ptrdiff_t)&(((s*)nullptr)->m)))
#endif
#endif
#elif (ACC_LIBC_FREESTANDING)
@@ -5771,9 +5771,9 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
ACCCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(int))
ACCCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(size_t))
#if !(ACC_BROKEN_SIZEOF)
ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(ACC_STATIC_CAST(char*, 0) - ACC_STATIC_CAST(char*, 0)))
ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(ACC_STATIC_CAST(char*, nullptr) - ACC_STATIC_CAST(char*, nullptr)))
# if (ACC_HAVE_MM_HUGE_PTR)
ACCCHK_ASSERT(4 == sizeof(ACC_STATIC_CAST(char __huge*, 0) - ACC_STATIC_CAST(char __huge*, 0)))
ACCCHK_ASSERT(4 == sizeof(ACC_STATIC_CAST(char __huge*, nullptr) - ACC_STATIC_CAST(char __huge*, nullptr)))
# endif
#endif
#if (ACC_SIZEOF_PTRDIFF_T > 0)