Bug 214183

Summary: [libcap-2.54] clang alignment warning
Product: Tools Reporter: Andrew G. Morgan (morgan)
Component: libcapAssignee: Andrew G. Morgan (morgan)
Status: RESOLVED CODE_FIX    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: n/a Subsystem:
Regression: No Bisected commit-id:

Description Andrew G. Morgan 2021-08-26 05:09:43 UTC
clang -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Dlinux -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -g  -fPIC -I/home/andrew/gits/libcap/libcap/../libcap/include/uapi -I/home/andrew/gits/libcap/libcap/../libcap/include -c cap_alloc.c -o cap_alloc.o
cap_alloc.c:150:33: warning: cast from 'uint32_t *' (aka 'unsigned int *') to 'struct cap_launch_s *' increases required alignment from 4 to 8 [-Wcast-align]
    struct cap_launch_s *attr = (struct cap_launch_s *) data;
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
cap_alloc.c:172:33: warning: cast from 'uint32_t *' (aka 'unsigned int *') to 'struct cap_launch_s *' increases required alignment from 4 to 8 [-Wcast-align]
    struct cap_launch_s *attr = (struct cap_launch_s *) data;
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.