-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Constify argv, fix warnings. (#1242)
* Fix perl warnings - 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> * Constify argv 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> * tcl: Do not duplicate const strings --------- Signed-off-by: Michal Suchanek <msuchanek@suse.de>
- Loading branch information
Showing
32 changed files
with
168 additions
and
209 deletions.
There are no files selected for viewing
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
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
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
Oops, something went wrong.