Skip to contentSkip to conversation

setools: cast increases required alignment of target type

DISCUSSION Laurent Bigonville 1 participant 2 messages Nov 24, 2016 – Nov 28, 2016 SELinux security module

lore
Share & tools
lore
#0 lore raw

Hi,

When compiling setools on at least mips64el and sparc64, I get the following error:

mips64el-linux-gnuabi64-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. -fstack-protector-strong -Wformat -Werror=format-security -Wno-sign-compare -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ilibqpol -Ilibqpol/include -I/usr/include/python3.5m -c libqpol/module_compiler.c -o build/temp.linux-mips64-3.5/libqpol/module_compiler.o -Werror -Wextra -Waggregate-return -Wcast-align -Wfloat-equal -Wformat -Wformat=2 -Winit-self -Winline -Wmissing-format-attribute -Wmissing-include-dirs -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wunknown-pragmas -Wwrite-strings -Wno-missing-field-initializers -Wno-unused-parameter -Wno-cast-qual -Wno-shadow -Wno-unreachable-code -fno-exceptions libqpol/module_compiler.c: In function ‘declare_symbol’:
libqpol/module_compiler.c:155:19: error: cast increases required alignment of target type [-Werror=cast-align]

    *dest_value = ((level_datum_t *)s)->level->sens;
                   ^
libqpol/module_compiler.c: In function ‘require_symbol’:
libqpol/module_compiler.c:650:19: error: cast increases required alignment of target type [-Werror=cast-align]
    *dest_value = ((level_datum_t *)s)->level->sens;
                   ^

libqpol/module_compiler.c: In function ‘require_bool_tunable’:
libqpol/module_compiler.c:1077:36: error: cast increases required alignment of target type [-Werror=cast-align]
require_symbol(SYM_BOOLS, id, (hashtab_datum_t *) booldatum,
^
libqpol/module_compiler.c: In function ‘require_cat’:
libqpol/module_compiler.c:1201:40: error: cast increases required alignment of target type [-Werror=cast-align]
retval = require_symbol(SYM_CATS, id, (hashtab_datum_t *) cat,

                                        ^

cc1: all warnings being treated as errors
error: command 'mips64el-linux-gnuabi64-gcc' failed with exit status 1

This is fatal only on some architectures, but I guess fixing this could also improve the performances on the others.

Regards,

Laurent Bigonville

#1 lore raw
Quoted 18 lines · Laurent Bigonville

Hi,

When compiling setools on at least mips64el and sparc64, I get the following error:

mips64el-linux-gnuabi64-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall

(quoted diff) +0 -4
-Wstrict-prototypes -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. 
-fstack-protector-strong -Wformat -Werror=format-security 
-Wno-sign-compare -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ilibqpol 
-Ilibqpol/include -I/usr/include/python3.5m -c 

libqpol/module_compiler.c -o build/temp.linux-mips64-3.5/libqpol/module_compiler.o -Werror -Wextra

(quoted diff) +0 -6
-Waggregate-return -Wcast-align -Wfloat-equal -Wformat -Wformat=2 
-Winit-self -Winline -Wmissing-format-attribute -Wmissing-include-dirs 
-Wnested-externs -Wold-style-definition -Wpointer-arith 
-Wredundant-decls -Wstrict-prototypes -Wunknown-pragmas 
-Wwrite-strings -Wno-missing-field-initializers -Wno-unused-parameter 
-Wno-cast-qual -Wno-shadow -Wno-unreachable-code -fno-exceptions

libqpol/module_compiler.c: In function ‘declare_symbol’:
libqpol/module_compiler.c:155:19: error: cast increases required alignment of target type [-Werror=cast-align]

Quoted 1 line
    *dest_value = ((level_datum_t *)s)->level->sens;

Well this is actually fixed in the master branch (9fbfeb43d20dd196b1831ef63b4a4f4f087a0be4) of setools and not the 4.0 one, nevermind then.