Opened 6 years ago
Last modified 5 years ago
#12172 new Bugs
Warning in ublas/matrix_expression.hpp from GCC 6.1.0 -Wmisleading-indentation
Reported by: | Owned by: | Gunter | |
---|---|---|---|
Milestone: | To Be Determined | Component: | uBLAS |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
When I compile with "-Wall -Wextra -Werror", I get:
.../boost/numeric/ublas/matrix_expression.hpp:2224:17: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
if (it2_ != it2_end_) ~
.../boost/numeric/ublas/matrix_expression.hpp:2227:21: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
if (it2_ != it2_end_) {
This appears to be a valid warning, and lines 2227 and 2228 should be un-indented by one level. Assuming this is not a real bug, that is.
Attachments (1)
Change History (6)
comment:1 by , 6 years ago
comment:4 by , 6 years ago
By pure coincidence, the two possible interpretations are equivalent. The condition being tested by the two if statements is the same, so the way it is written now is slightly less efficient, but still produces the right result. The patch proposed by khalil is probably what the original author intended.
In other words, you don't need to worry about regressions.
comment:5 by , 5 years ago
khalil's patch is consistent with 1.57. Best to find out why it changed in the first place.
not only is that a valid warning. The logical guarding of the if block differs in the increment function from the matching code in the "decrement" function below -- this probably needs algorithmic review, not just indentation fixing.