Conversation
b73fe25 to
a05c390
Compare
0daa001 to
a68cee6
Compare
|
Looks good to me, ready to merge. There are probably some other modules with wrong array indexing, but I recommend to put these issues in a separate PR if needed. |
9281283 to
a86a4b3
Compare
Thanks a lot! I did rearrange the commits: separated the fixes for
At the moment these two are the only places reported by clang. |
metzm
left a comment
There was a problem hiding this comment.
Interesting how many occurrences of abs() needed to be replaced with fabs()!
Thanks for your work, IMHO now ready to merge.
|
If there are no objections, I will take the liberty to merge in the next couple of days. |
wenzeslaus
left a comment
There was a problem hiding this comment.
+1, but I'm also wondering about that commented out code in stream extract. I don't see anything useful in r.watershed blame.
I think, if it is just wrong, it should be deleted with a proper commit message (it is in the history after all if needed). If it is servers as a reminder of something, a comment should be added saying why it is there instead of leaving the reader wondering.
Commenting out all code would indeed fix all or most of compiler warnings, but that would be certainly an unexpected thing to find behind a "fix warnings commit". 😄
Good point. Although I can live with commented out code (for readily available reminder in case...), it certainly need a commit (with message) on its own. Do you have any suggestion, @metzm? |
a86a4b3 to
d6b1721
Compare
|
I separated the commented out code in |
Delete the commented out code, no need to keep it. |
d6b1721 to
8687b82
Compare
|
Apparently there is no way for me to merge this without sqashing all commits. |
Yes, please give it a try. |
as Option->answer is declared as as "char *". Addresses -Wc++11-compat-deprecated-writable-strings compiler warnings.
Addresses -Wdangling-else compiler warning.
to respect array bounds: avoid call to array index, which is past the end of the array. (#1248) Addresses -Warray-bounds compiler warnings. Co-authored-by: Markus Metz <[email protected]> Co-authored-by: Huidae Cho <[email protected]>
to respect array bounds: avoid call to array index, which is past the end of the array. (#1248) Addresses -Warray-bounds compiler warnings.
according to given argument type. (#1248) Addresses -Wabsolute-value compiler warnings.
for setting main drainage direction to A* path if possible. (#1248) Co-authored-by: Markus Metz <[email protected]>
|
Merged through cherry picking. Closing this manually. |
as Option->answer is declared as as "char *". Addresses -Wc++11-compat-deprecated-writable-strings compiler warnings.
Addresses -Wdangling-else compiler warning.
to respect array bounds: avoid call to array index, which is past the end of the array. (OSGeo#1248) Addresses -Warray-bounds compiler warnings. Co-authored-by: Markus Metz <[email protected]> Co-authored-by: Huidae Cho <[email protected]>
to respect array bounds: avoid call to array index, which is past the end of the array. (OSGeo#1248) Addresses -Warray-bounds compiler warnings.
according to given argument type. (OSGeo#1248) Addresses -Wabsolute-value compiler warnings.
for setting main drainage direction to A* path if possible. (OSGeo#1248) Co-authored-by: Markus Metz <[email protected]>
as Option->answer is declared as as "char *". Addresses -Wc++11-compat-deprecated-writable-strings compiler warnings.
Addresses -Wdangling-else compiler warning.
to respect array bounds: avoid call to array index, which is past the end of the array. (OSGeo#1248) Addresses -Warray-bounds compiler warnings. Co-authored-by: Markus Metz <[email protected]> Co-authored-by: Huidae Cho <[email protected]>
to respect array bounds: avoid call to array index, which is past the end of the array. (OSGeo#1248) Addresses -Warray-bounds compiler warnings.
according to given argument type. (OSGeo#1248) Addresses -Wabsolute-value compiler warnings.
for setting main drainage direction to A* path if possible. (OSGeo#1248) Co-authored-by: Markus Metz <[email protected]>
as Option->answer is declared as as "char *". Addresses -Wc++11-compat-deprecated-writable-strings compiler warnings.
Addresses -Wdangling-else compiler warning.
to respect array bounds: avoid call to array index, which is past the end of the array. (OSGeo#1248) Addresses -Warray-bounds compiler warnings. Co-authored-by: Markus Metz <[email protected]> Co-authored-by: Huidae Cho <[email protected]>
to respect array bounds: avoid call to array index, which is past the end of the array. (OSGeo#1248) Addresses -Warray-bounds compiler warnings.
according to given argument type. (OSGeo#1248) Addresses -Wabsolute-value compiler warnings.
for setting main drainage direction to A* path if possible. (OSGeo#1248) Co-authored-by: Markus Metz <[email protected]>
…obust (#6543) This block got removed as part of compiler warnings cleanup #1248, but the removal broke special cases (#6541). The intention of r.stream.extract is to use external flow accumulation for stream extraction, but if in doubt follow the A* search direction, i.e. if (fabs(wat_nbr[np_side]) >= max_acc). Restoring this deleted code block in addition to #6554 should make r.stream.extract robust for special cases as reported in #6541.
Fixes compiler warnings:
First part addressing #1247.
There are a couple of ambivalent cases and I'm not sure how to correctly address them.
I hope for input from experienced C programmers and leave this open as a draft.
Update:
Modules / code parts directly affected: