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.