git: ecefb5d33ceb - stable/13 - sys: Disable -Walloc-size-larger-than for GCC 9+
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 30 Nov 2024 19:09:15 UTC
The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ecefb5d33cebb599ffcc8f6ae29354eb6e798424 commit ecefb5d33cebb599ffcc8f6ae29354eb6e798424 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2023-11-15 02:37:25 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2024-11-30 19:07:56 +0000 sys: Disable -Walloc-size-larger-than for GCC 9+ 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 (cherry picked from commit ede077bf2a259c23923d1ab1231dc8c4577e6672) --- sys/conf/kern.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 7a2cc4bfa7ff..5e79dd2af66a 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -88,6 +88,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 \