Two skalibs compiler warnings on RHEL 7

From: J. Lewis Muir <jlmuir_at_imca-cat.org>
Date: Mon, 2 Dec 2019 16:42:53 -0600

Hello!

On x86_64 RHEL 7.7 with GCC 4.8.5, configuring and compiling skalibs
2.9.1.0 with

----
$ ./configure --disable-static
$ make
----
results in a clean compile except for the following two warnings:
----
exec gcc -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -Isrc/include -fPIC -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith -Wno-unused-value -Wno-parentheses  -pipe -Wall -std=c99 -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -Wa,--noexecstack -ffunction-sections -fdata-sections -O2 -fomit-frame-pointer -fno-stack-protector   -c -o src/libunixonacid/textclient_server_init_fromsocket.lo src/libunixonacid/textclient_server_init_fromsocket.c
src/libunixonacid/textclient_server_init_fromsocket.c: In function ‘sendit’:
src/libunixonacid/textclient_server_init_fromsocket.c:56:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   *(int *)CMSG_DATA(c) = fd[1] ;
   ^
exec gcc -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -Isrc/include -fPIC -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith -Wno-unused-value -Wno-parentheses  -pipe -Wall -std=c99 -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -Wa,--noexecstack -ffunction-sections -fdata-sections -O2 -fomit-frame-pointer -fno-stack-protector   -c -o src/libunixonacid/textclient_start.lo src/libunixonacid/textclient_start.c
src/libunixonacid/textclient_start.c: In function ‘get’:
src/libunixonacid/textclient_start.c:77:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   fd[1] = *(int *)CMSG_DATA(c) ;
   ^
----
On RHEL 7, according to the cmsg(3) man page, CMSG_DATA has a return
type of "unsigned char *".
Thank you,
Lewis
Received on Mon Dec 02 2019 - 22:42:53 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC