Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checks: Fix -Wunused-but-set-variable compiler warnings, part 1 #2648

Merged
merged 5 commits into from
Nov 17, 2022

Conversation

nilason
Copy link
Contributor

@nilason nilason commented Nov 14, 2022

Compiling with -Wall using Clang 14 throws some 150 -Wunused-but-set-variable warnings. Fixing them are in the majority of cases just spring-cleaning. Here is the first batch of two, addressing them. Now affecting following parts:

db/drivers
dbf
ogr
postgres
sqlite

display
d.grid
d.histogram
d.path
d.vect.thematic

imagery
i.albedo
i.aster.toar
i.eb.netrad
i.evapo.time
i.ortho.photo
i.segment

mics
m.nviz.image
m.nviz.script

raster
r.in.ascii
r.in.mat
r.kappa
r.kappa
r.li/r.li.daemon
r.out.png
r.out.pov
r.random.cells
r.random.surface
r.regression.multi
r.report
r.ros
r.series
r.sim/r.sim.water
r.sim/simlib
r.solute.transport
r.spread
r.univar
r.viewshed
r.watershed/ram
r.watershed/seg

raster3d
r3.cross.rast
r3.out.v5d

vector
v.hull
v.in.dxf
v.info
v.kernel
v.label.sa
v.out.vtk
v.overlay
v.to.rast
v.vol.rst

lib
vector/dglib

Reported in #2156. Accompanied by #2650.

@nilason nilason mentioned this pull request Nov 14, 2022
21 tasks
Warnings on comparison of narrow type with wide type in loop condition.
@nilason nilason added enhancement New feature or request C Related code is in C labels Nov 14, 2022
@nilason nilason added this to the 8.3.0 milestone Nov 14, 2022
@nilason
Copy link
Contributor Author

nilason commented Nov 14, 2022

CodeQL warnings are addressed with #2649.

@nilason nilason merged commit 9ad9856 into OSGeo:main Nov 17, 2022
@nilason nilason deleted the fix_wunused-but-set-variable_other branch November 17, 2022 13:09
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
marisn pushed a commit to marisn/grass that referenced this pull request Jun 2, 2023
@neteler neteler changed the title Fix -Wunused-but-set-variable compiler warnings, part 1 checks: Fix -Wunused-but-set-variable compiler warnings, part 1 Jun 6, 2023
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants