Skip to content

Comments

checks: Fix -Wtautological-overlap-compare compiler warning#2157

Merged
nilason merged 1 commit intoOSGeo:mainfrom
nilason:fix_wall_warnings_01
Mar 2, 2022
Merged

checks: Fix -Wtautological-overlap-compare compiler warning#2157
nilason merged 1 commit intoOSGeo:mainfrom
nilason:fix_wall_warnings_01

Conversation

@nilason
Copy link
Contributor

@nilason nilason commented Feb 4, 2022

As reported in #2156.

Affects:

  • r.slope.aspect

@nilason nilason mentioned this pull request Feb 4, 2022
21 tasks
@nilason nilason added this to the 8.2.0 milestone Feb 4, 2022
@nilason nilason added C Related code is in C enhancement New feature or request labels Feb 4, 2022
@wenzeslaus
Copy link
Member

Isn't the original code a bug? It never prints north, right?

                if (i == 0 && i == 360)
                    sprintf(buf, "north");

I suggest re-framing it this PR as a bug fix for r.slope.aspect instead of a warning fix to draw attention to this issue.

@nilason
Copy link
Contributor Author

nilason commented Feb 4, 2022

Isn't the original code a bug? It never prints north, right?

                if (i == 0 && i == 360)
                    sprintf(buf, "north");

I suggest re-framing it this PR as a bug fix for r.slope.aspect instead of a warning fix to draw attention to this issue.

You're right, this is one of those warnings that are more than noise.
It's soon a year since I prepared the bulk of these PRs, so good you mention it, I now remember this standing out.

This was introduced with: 772baae by @metzm .

@nilason nilason added backport_needed bug Something isn't working and removed enhancement New feature or request labels Feb 4, 2022
@nilason nilason modified the milestones: 8.2.0, 8.0.1, 7.8.7 Feb 4, 2022
@nilason
Copy link
Contributor Author

nilason commented Feb 5, 2022

@metzm Could you please check if my fix is correct.

Whatever will be the solution, this have to be backported to 7.8.7 (as well as to 8.0.1).

@neteler neteler modified the milestones: 7.8.7, 7.8.8 Feb 24, 2022
@metzm
Copy link
Contributor

metzm commented Mar 2, 2022

The fix is correct, please merge and backport.

@nilason nilason merged commit b712ecd into OSGeo:main Mar 2, 2022
nilason added a commit that referenced this pull request Mar 2, 2022
Addresses a -Wtautological-overlap-compare compiler warning.
nilason added a commit that referenced this pull request Mar 2, 2022
Addresses a -Wtautological-overlap-compare compiler warning.
@nilason
Copy link
Contributor Author

nilason commented Mar 2, 2022

Thanks @metzm! Merged and backported to 8.0 and 7.8.

@nilason nilason deleted the fix_wall_warnings_01 branch March 18, 2022 16:12
@wenzeslaus wenzeslaus changed the title Fix -Wtautological-overlap-compare compiler warning checks: Fix -Wtautological-overlap-compare compiler warning Apr 27, 2022
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
Addresses a -Wtautological-overlap-compare compiler warning.
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
Addresses a -Wtautological-overlap-compare compiler warning.
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
Addresses a -Wtautological-overlap-compare compiler warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working C Related code is in C

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants