Page MenuHomeFreeBSD

libzpool: Set -Wno-error=typedef-redefinition for clang
ClosedPublic

Authored by ivy on Mon, Apr 27, 3:49 AM.
Tags
None
Referenced Files
F156851380: D56653.id176601.diff
Sat, May 16, 9:59 PM
Unknown Object (File)
Thu, May 14, 11:20 AM
Unknown Object (File)
Thu, May 14, 11:20 AM
Unknown Object (File)
Thu, May 14, 7:43 AM
Unknown Object (File)
Wed, May 13, 6:31 PM
Unknown Object (File)
Sun, May 10, 10:51 PM
Unknown Object (File)
Sat, May 9, 8:33 AM
Unknown Object (File)
Fri, May 8, 2:22 PM
Subscribers

Details

Summary

In some versions of LLVM (at least 21), the <*intrin.h> headers contain
unguarded duplicate typedefs; this isn't permitted prior to C11, and
libzpool is built as C99. FreeBSD's LLVM backported LLVM PR #153820
to fix this, but other versions of LLVM (e.g., upstream, or on Linux)
don't have the patch, so this breaks the build.

Add -Wno-error=typedef-redefinition to downgrade this from an error
to a warning.

Sponsored by: https://www.patreon.com/bsdivy

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ivy requested review of this revision.Mon, Apr 27, 3:49 AM

If this doesn't happen too often across the tree, I'm fine with this approach. If there are more, it may make sense to put a generic macro (e.g. NO_WTYPEDEF_REDEFINITION) in bsd.sys.mk, like we have done for some other annoying warnings.

This revision is now accepted and ready to land.Mon, Apr 27, 11:32 AM
In D56653#1297844, @dim wrote:

If this doesn't happen too often across the tree, I'm fine with this approach. If there are more, it may make sense to put a generic macro (e.g. NO_WTYPEDEF_REDEFINITION) in bsd.sys.mk, like we have done for some other annoying warnings.

this is the only case i found when testing this, and the only other existing use is in tools/build/mk/Makefile.boot which is a little special, so i think we're fine just inlining this here. i do wonder if we couldn't instead build OpenZFS as C17 like the rest of the system...

build OpenZFS as C17 like the rest of the system

We probably could, but I assume we're just following what upstream does.