mirror of
https://github.com/SELinuxProject/selinux
synced 2024-12-27 08:22:07 +00:00
14c0564641
gcc puts literal strings lie in read-only memory. On x86_64, trying to write to them triggers a segmentation fault. To detect such issues at build time, variables holding a pointer to such strings should be "const char*". "gcc -Wwrite-strings" warns when using non-const pointers to literal strings. Remove gcc warnings by adding const to local variables and argumens of internal functions. This does *not* fix this warning: policydb_public.c:208:10: warning: passing argument 2 of 'hashtab_search' discards 'const' qualifier from pointer target type return (hashtab_search(p->p.p_classes.table, PACKET_CLASS_NAME) == ^ In file included from ../include/sepol/policydb/symtab.h:16:0, from ../include/sepol/policydb/policydb.h:60, from policydb_public.c:4: ../include/sepol/policydb/hashtab.h:98:24: note: expected 'hashtab_key_t' but argument is of type 'const char *' extern hashtab_datum_t hashtab_search(hashtab_t h, const hashtab_key_t k); ^ Moreover the "const" word in hashtab_search prototype does not make the second parameter "const char*" but "char* const". Acked-by: Steve Lawrence <slawrence@tresys.com> |
||
---|---|---|
.. | ||
policydb | ||
boolean_record.h | ||
booleans.h | ||
context_record.h | ||
context.h | ||
debug.h | ||
errcodes.h | ||
handle.h | ||
iface_record.h | ||
interfaces.h | ||
module.h | ||
node_record.h | ||
nodes.h | ||
policydb.h | ||
port_record.h | ||
ports.h | ||
roles.h | ||
sepol.h | ||
user_record.h | ||
users.h |