diff options
author | albert-github <albert.tests@gmail.com> | 2020-06-30 10:07:01 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2020-06-30 10:07:01 (GMT) |
commit | bfe44c22752c443d1e74923137c065f901134478 (patch) | |
tree | fa4dcf9e1bd4b183a27d97b903175c29a9b41e43 /src | |
parent | 3e9d9386950cc67d155a920cf8483c4d5bdcec3c (diff) | |
download | Doxygen-bfe44c22752c443d1e74923137c065f901134478.zip Doxygen-bfe44c22752c443d1e74923137c065f901134478.tar.gz Doxygen-bfe44c22752c443d1e74923137c065f901134478.tar.bz2 |
Misleading compiler warning
When compiling on Cygwin (gcc version 9.3.0 (GCC)) in release mode we get:
```
In file included from /cygdrive/d/Programs/Doxygen/fork/doxygen/src/vhdldocgen.cpp:27:
/cygdrive/d/Programs/Doxygen/fork/doxygen/qtools/qcstring.h: In static member function ‘static void FlowChart::colTextNodes()’:
/cygdrive/d/Programs/Doxygen/fork/doxygen/qtools/qcstring.h:364:23: warning: ‘flno’ may be used uninitialized in this function [-Wmaybe-uninitialized]
364 | if (str) m_rep+=str;
| ^~~
/cygdrive/d/Programs/Doxygen/fork/doxygen/src/vhdldocgen.cpp:3178:14: note: ‘flno’ was declared here
3178 | FlowChart *flno;
| ^~~~
```
The compiler doesn't "understand" that `flno` is guarded by `found` and this would be initialized.
Local variable `text` is not used so removed.
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdldocgen.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index ff96331..28a2028 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -3174,20 +3174,18 @@ void FlowChart::printFlowTree() void FlowChart::colTextNodes() { - QCString text; - FlowChart *flno; + FlowChart *flno = NULL; bool found=FALSE; for (uint j=0;j<flowList.count();j++) { FlowChart *flo=flowList.at(j); if (flo->type&TEXT_NO) { - text+=flo->text+'\n'; if (!found) { flno=flo; } - if (found) + else { flno->text+=flo->text; flowList.remove(flo); |