public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/115587] New: Possible uninitialized variable (decl) in c_parser_omp_loop_nest
@ 2024-06-22  4:19 pinskia at gcc dot gnu.org
  2024-06-22  4:24 ` [Bug c/115587] [14/15 Regression] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-22  4:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115587
           Summary: Possible uninitialized variable (decl) in
                    c_parser_omp_loop_nest
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: internal-improvement, openmp
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

clang gives the following warning:
```
/home/worker/buildworker/tiber-gcc-clang/build/gcc/c/c-parser.cc:22585:12:
warning: variable 'decl' is used uninitialized whenever '&&' condition is false
[-Wsometimes-uninitialized]
/home/worker/buildworker/tiber-gcc-clang/build/gcc/c/c-parser.cc:22585:12:
warning: variable 'decl' is used uninitialized whenever 'if' condition is false
[-Wsometimes-uninitialized]
```
I looked into the code and it does look like decl could be used uninitialized.
It is a complex path to get there though so it is hard to tell.
It is also only on the error path and it does not look like it would cause any
issues to be used here uninitialized though since it is never accessed directly
on that path.

I think initializing it to null after error_init, will fix the warning and have
the same effect as right now.
But someone who knows this code better should look into it.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-06-25 21:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-22  4:19 [Bug c/115587] New: Possible uninitialized variable (decl) in c_parser_omp_loop_nest pinskia at gcc dot gnu.org
2024-06-22  4:24 ` [Bug c/115587] [14/15 Regression] " pinskia at gcc dot gnu.org
2024-06-22 12:29 ` rguenth at gcc dot gnu.org
2024-06-23  4:17 ` sandra at gcc dot gnu.org
2024-06-23  4:19 ` [Bug c/115587] [14/15 Regression] Possible uninitialized variable (decl) in c_parser_omp_loop_nest since r14-3489-g143151ac2013c2 sjames at gcc dot gnu.org
2024-06-25 14:29 ` cvs-commit at gcc dot gnu.org
2024-06-25 14:35 ` sandra at gcc dot gnu.org
2024-06-25 21:47 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).