Commit 48a34f7
fix some cppcheck and compiler warnings (#93)
* fix cppcheck findings:
[simplecpp.h:182] -> [simplecpp.cpp:226]: (style, inconclusive) Function 'push_back' argument 1 names different: declaration 'token' definition 'tok'.
[simplecpp.h:249] -> [simplecpp.cpp:872]: (style, inconclusive) Function 'constFoldQuestionOp' argument 1 names different: declaration 'tok' definition 'tok1'.
[simplecpp.cpp:1643]: (performance, inconclusive) Technically the member function 'simplecpp::Macro::isReplaced' can be static.
* makefile: add -Warning flags that cppcheck uses to simplecpp build.
Namely:
-Wabi
-Wcast-qual
-Wfloat-equal
-Wmissing-declarations
-Wmissing-format-attribute
-Wredundant-decls
-Wshadow
* fix -Wshadow warning.
Was:
main.cpp:65:35: warning: declaration shadows a local variable [-Wshadow]
for (const simplecpp::Output &output : outputList) {
^
main.cpp:60:26: note: previous declaration is here
simplecpp::TokenList output(files);
^
1 warning generated.1 parent 39ac1a3 commit 48a34f7
4 files changed
Lines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1640 | 1640 | | |
1641 | 1641 | | |
1642 | 1642 | | |
1643 | | - | |
| 1643 | + | |
1644 | 1644 | | |
1645 | 1645 | | |
1646 | 1646 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| |||
0 commit comments