[Bug analyzer/126858] -Wanalyzer-use-of-uninitialized-value false positive with printf's %n

vincent-gcc at vinc17 dot net via Gcc-bugs <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126858

--- Comment #2 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
(In reply to Vincent Lefèvre from comment #1)
> Here, I don't think that GCC knows that check_vfprintf is like fprintf. So
> the bug may be more general, with function calls having an argument taking
> an address, in which case the analyzer may not be able to determine whether
> the variable is initialized. But this should never generate a false positive.

Indeed, from the code of the MPFR testsuite, I could derive another simple
testcase, but it seems rather different from the above one with printf, for 2
reasons:
1. One needs at least 3 arguments.
2. One needs to use an intermediate function with va_list.

Reported as PR126859.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.