Skip to content

Commit

Permalink
sys: Disable -Walloc-size-larger-than for GCC 9+
Browse files Browse the repository at this point in the history
By default this warns about sizes larger than PTRDIFF_MAX passed to
malloc (rather than SIZE_MAX).  This doesn't trigger
deterministically, but it does trigger for kmalloc() of struct_size()
in iwlwifi's iwl_configure_rxq even when struct_size() is changed to
use PTRDIFF_MAX.  NB: struct_size() in Linux caps the size at
SIZE_MAX, not PTRDIFF_MAX via size_mul().

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D42587
  • Loading branch information
bsdjhb committed Nov 15, 2023
1 parent be909a7 commit ede077b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sys/conf/kern.mk
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ CWARNEXTRA+= -Wno-error=packed-not-aligned
.endif
.if ${COMPILER_VERSION} >= 90100
CWARNEXTRA+= -Wno-address-of-packed-member \
-Wno-alloc-size-larger-than \
-Wno-error=alloca-larger-than=
.if ${COMPILER_VERSION} >= 120100
CWARNEXTRA+= -Wno-error=nonnull \
Expand Down

0 comments on commit ede077b

Please sign in to comment.