https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108944
--- Comment #2 from David Binderman <dcb314 at hotmail dot com> --- (In reply to Gaius Mulley from comment #1) > Thank you very much for reporting this bug - very useful regarding PR108835 > (or at least it is related and timely). You are welcome. gcc flags -Wall and -Wmemset-transposed-args seem to provide this warning. For example: memset.cc:17:15: warning: ‘memset’ used with constant zero length parameter; thi s could be due to transposed parameters [-Wmemset-transposed-args] 17 | memset( t.buf1, 20, 0); | ~~~~~~^~~~~~~~~~~~~~~~