[PATCH] D35554: Add NetBSD support in sanitizer_platform_limits_posix.*

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 10:06:32 PDT 2017


krytarowski added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_platform_limits_posix.h:53
   extern unsigned struct_stat_sz;
-#if !SANITIZER_FREEBSD && !SANITIZER_IOS
+#if !SANITIZER_FREEBSD && !SANITIZER_IOS && !SANITIZER_NETBSD
   extern unsigned struct_stat64_sz;
----------------
glider wrote:
> I suggest we always keep SANITIZER_FREEBSD and SANITIZER_NETBSD together in the ifdefs:
> `  !SANITIZER_FREEBSD && !SANITIZER_NETBSD && !SANITIZER_IOS`
> 
> By the way, do we need a special `SANITIZER_BSD` for the common BSD-specific cases?
> I guess in many cases `SANITIZER_FREEBSD || SANITIZER_NETBSD` also means "or other BSD system"
> 
I think that we should keep alphabetical order, both systems diverged over 20 years ago and besides common ancestors decades ago, they are different. Linux adopted BSD interfaces too (like ptrace(2)).

SANITIZER_BSD has no point in my opinion. Pretending that something is BSD-flavor and defining it as a standard is a losing battle, we all are struggling to be compatible with POSIX. Old interfaces over they years were refactored, deprecated, replaced, abandoned, reinvented etc. We will end up with `SANITIZER_BSD && !SANITIZER_OPENBSD` and similar.


Repository:
  rL LLVM

https://reviews.llvm.org/D35554





More information about the llvm-commits mailing list