libsepol/cil: silence clang void-pointer-to-enum-cast warning

Add an intermediate cast to uintptr_t to silence the clang specific
warning about casting a void pointer to an enum.

    ../cil/src/cil_verify.c:1749:28: error: cast to smaller integer type 'enum cil_flavor' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast]
                                                    enum cil_flavor op = (enum cil_flavor)i->data;
                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~

Similar to 32f8ed3d6b.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
Christian Göttsche 2021-09-28 17:46:15 +02:00 committed by James Carter
parent e0968a8640
commit 6c81478456

View File

@ -1746,7 +1746,7 @@ static int __cil_verify_classperms(struct cil_list *classperms,
goto exit;
}
} else {
enum cil_flavor op = (enum cil_flavor)i->data;
enum cil_flavor op = (enum cil_flavor)(uintptr_t)i->data;
if (op == CIL_ALL) {
struct cil_class *mc = cp->class;
struct cil_list *perm_list;