https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106394
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tim Lange <tla...@gcc.gnu.org>: https://gcc.gnu.org/g:b4cc945c045db74f719ab030969806c14e2d5fc3 commit r13-1802-gb4cc945c045db74f719ab030969806c14e2d5fc3 Author: Tim Lange <m...@tim-lange.me> Date: Fri Jul 22 21:44:07 2022 +0200 Fix handling of zero capacity regions in -Wanalyzer-allocation-size [PR106394] This patch unifies the handling of zero capacity regions for structs and other types in the allocation size checker. Regression-tested on x86_64 Linux. 2022-07-22 Tim Lange <m...@tim-lange.me> gcc/analyzer/ChangeLog: PR analyzer/106394 * region-model.cc (capacity_compatible_with_type): Always return true if alloc_size is zero. gcc/testsuite/ChangeLog: PR analyzer/106394 * gcc.dg/analyzer/pr106394.c: New test.