Commit 262ed31
committed
libselinux: explicitly ignore return values
Tell GCC, see [1], to actually no issue warnings about explicitly
ignored return values.
Also explicitly ignored return values in cleanup handlers.
togglesebool.c: In function ‘rollback’:
togglesebool.c:18:17: error: ignoring return value of ‘security_set_boolean’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
18 | security_set_boolean(argv[i],
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 | security_get_boolean_active(argv[i]));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
load_policy.c: In function ‘selinux_init_load_policy’:
load_policy.c:329:17: error: ‘security_disable’ is deprecated: SELinux runtime disable is deprecated [-Werror=deprecated-declarations]
329 | rc = security_disable();
| ^~
booleans.c: In function ‘rollback’:
booleans.c:332:17: error: ignoring return value of ‘security_set_boolean’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
332 | security_set_boolean(boollist[i].name,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
333 | security_get_boolean_active(boollist[i].
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
334 | name));
| ~~~~~~
checkAccess.c: In function ‘selinux_check_access’:
checkAccess.c:42:16: error: ignoring return value of ‘selinux_status_updated’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
42 | (void) selinux_status_updated();
| ^~~~~~~~~~~~~~~~~~~~~~~~
avc.c: In function ‘avc_has_perm_noaudit’:
avc.c:761:24: error: ignoring return value of ‘selinux_status_updated’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
761 | (void) selinux_status_updated();
| ^~~~~~~~~~~~~~~~~~~~~~~~
[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
Signed-off-by: Christian Göttsche <[email protected]>1 parent 2db81f1 commit 262ed31
File tree
5 files changed
+5
-5
lines changed- libselinux
- src
- utils
5 files changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
760 | | - | |
| 760 | + | |
761 | 761 | | |
762 | 762 | | |
763 | 763 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
0 commit comments