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
Constify argv, fix warnings. #1242
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
hramrach
commented
Dec 25, 2023
- cast POPs to void to avoid unused value warning - declare functions that don't set RETVAL as returning void Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1242 +/- ##
=======================================
Coverage 51.01% 51.02%
=======================================
Files 45 45
Lines 18213 18214 +1
=======================================
+ Hits 9291 9293 +2
+ Misses 8922 8921 -1 ☔ View full report in Codecov by Sentry. |
@hramrach thanks for the patch! Please update the CHANGES file as well, then I think we are ready to merge. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
c72578
previously approved these changes
Jan 3, 2024
c72578
reviewed
Jan 3, 2024
rrd has no business modifying the string pointed to by passed agrv, and as far as gcc can see it does indeed not modify them because it compiles with const argv. This fixes warnings when passing const strings into rrd, and avoids the need to duplicate all strings in the tcl bindings. This fixes warnings like these: [ 3s] prog/sensord/rrd.c: In function 'rrdInit': [ 3s] prog/sensord/rrd.c:302:40: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual] [ 3s] 302 | ret = rrd_create(argc, (char**) argv); [ 3s] | ^ [ 3s] prog/sensord/rrd.c: In function 'rrdUpdate': [ 3s] prog/sensord/rrd.c:458:42: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual] [ 3s] 458 | if ((ret = rrd_update(3, (char **) /* WEAK */ argv))) { [ 3s] | ^ Signed-off-by: Michal Suchanek <msuchanek@suse.de>
c72578
approved these changes
Jan 4, 2024
oetiker
approved these changes
Jan 5, 2024
yselkowitz
added a commit
to yselkowitz/lm-sensors
that referenced
this pull request
Feb 11, 2024
rrdtool has applied a patch to constify all argv parameters, which fixes incompatible pointer type errors with GCC 14. This patch adapts accordingly, but would trigger similar errors against an rrdtool without that change. oetiker/rrdtool-1.x#1242 Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.