Commit Graph

2 Commits

Author SHA1 Message Date
Nicolas Iooss
edca1ac4c7 Treat literal strings as constant
Literal strings are located in read-only memory and should be "const
char*".  "gcc -Wwrite-strings" warns when using non-const literal
strings with messages like:

    libqpol/policy_parse.y: In function 'yyparse':
    libqpol/policy_parse.y:381:21: warning: passing argument 1 of
    'insert_id' discards 'const' qualifier from pointer target type
         { if (insert_id("T",0)) return -1; }
                     ^

Fix these warnings by using "const char*" instead of "char*" for some
function parameters.

This makes gcc report other warnings about hashtab_search (from
libsepol).  This function incorrectly defines its second parameter as
"char *const key" instead of "const char* key" (this fact is hidden
behind hashtab_key_t typedef).
2014-11-02 13:02:59 -05:00
Chris PeBenito
8363f8edf7 Import libqpol from setools3.
Break setools3 dependence. Also fix SWIG wrapper to work with SWIG 2.x.
2014-10-24 21:00:24 -04:00