On Tue, 2026-03-17 at 09:59 +0100, Tomás Ortín Fernández wrote: > The patch "analyzer: new warnings -Wanalyzer-mkstemp-missing-suffix > and -Wanalyzer-mkstemp-of-string-literal [PR105890]" added those two > warnings for mkstemp only. This patch generalizes them to the whole > mktemp family (including GNU extensions): mktemp, mkstemp, mkostemp, > mkstemps, mkostemps, and mkdtemp. > > The two warnings are renamed to reflect their broader scope: > > -Wanalyzer-mkstemp-missing-suffix becomes > -Wanalyzer-mktemp-missing-placeholder. For the suffixed variants > (mkstemps, mkostemps), the diagnostic accounts for the suffix > length > when locating the "XXXXXX" placeholder. > > -Wanalyzer-mkstemp-of-string-literal becomes > -Wanalyzer-mktemp-of-string-literal. > > A new warning is also added: > > -Wanalyzer-mkostemp-redundant-flags warns when mkostemp or > mkostemps is called with flags that include O_RDWR, O_CREAT, or > O_EXCL, which are already implied by these functions and produce > errors on some systems. > > All three warnings are enabled by default under -fanalyzer. > > Bootstrapped and tested on x86_64-pc-linux-gnu.
Thanks for the updated patch; it looks good. I've added it to my queue of patches to push when GCC 17 development opens. Dave
