[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 #1 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
Note: This error is triggered by tfprintf.c of the GNU MPFR testsuite:

  int n;

  check_vfprintf (fout, ".%c%c.%n", 0, 1, &n);
  check_length (40, n, 4, d);

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.
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.