https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123146

            Bug ID: 123146
           Summary: Improve wording for "'use of uninitialized value
                    '<return-value>' here"
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

After r16-6063-g0b786d961d4426 the analyzer now complains about paths that
"fall off the bottom" of non-void-returning functions, albeit with this
message:

../../src/gcc/testsuite/gcc.dg/analyzer/compound-assignment-2.c:23:1: warning:
use of uninitialized value ‘<return-value>’ [CWE-457]
[-Wanalyzer-use-of-uninitialized-value]
   23 | } /* { dg-warning "leak of 'aw2.ptrs.0.'" "leak of element 0" } */
      | ^
  ‘test_2’: events 1-3
   18 | test_2 (void)
      | ^~~~~~
      | |
      | (1) region created on stack here
      | (2) capacity: 16 bytes
......
   23 | } /* { dg-warning "leak of 'aw2.ptrs.0.'" "leak of element 0" } */
      | ~
      | |
      | (3) ⚠️  use of uninitialized value ‘<return-value>’ here

We should improve the wording for this case (and perhaps use a different
command-line option)

Reply via email to