[PATCH 6/8] semodule_deps: hide -Wwrite-strings warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



generate_requires() may use a non-freable strings, BASE_NAME, as key in
a hashtable. The compiler complains about this small abuse of
hashtab_insert() interface (because its argument key is char* without
"const"). Nevertheless this is all right because the hashtab keys are
never freed directly (this behavior is documented in a comment in
free_requires()).

Therefore, hide the compiler warning by casting BASE_NAME to char*.

Signed-off-by: Nicolas Iooss <nicolas.iooss@xxxxxxx>
---
 semodule-utils/semodule_deps/semodule_deps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/semodule-utils/semodule_deps/semodule_deps.c b/semodule-utils/semodule_deps/semodule_deps.c
index ab99d159f788..8048ee02d3ca 100644
--- a/semodule-utils/semodule_deps/semodule_deps.c
+++ b/semodule-utils/semodule_deps/semodule_deps.c
@@ -40,7 +40,7 @@ extern int optind;
  * thing is done in the linker for displaying error
  * messages.
  */
-#define BASE_NAME "BASE"
+#define BASE_NAME ((char *)"BASE")
 
 static void usage(char *program_name)
 {
-- 
2.11.0

_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.



[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux