OpenDMARC
OpenDMARC copied to clipboard
Many occurences of -Wpointer-sign warning with clang under FreeBSD
Modern versions of clang through this warning. A full make clean/make is attached.
One example:
opendmarc-check.c:95:40: warning: passing 'char [10]' to parameter of type 'u_char *' (aka 'unsigned char *') converts between pointers to integer types with different sign [-Wpointer-sign]
dmarc = opendmarc_policy_connect_init(LOCALHOST, FALSE);
^~~~~~~~~
opendmarc-check.c:33:19: note: expanded from macro 'LOCALHOST'
#define LOCALHOST "127.0.0.1"
^~~~~~~~~~~
./../libopendmarc/dmarc.h:113:56: note: passing argument to parameter 'ip_addr' here
DMARC_POLICY_T * opendmarc_policy_connect_init(u_char *ip_addr, int ip_type);
^
For reference:
FreeBSD poudriere.foo.org 12.2-STABLE FreeBSD 12.2-STABLE stable/12-n1-2655a711d GENERIC amd64
My C is not strong enough to know the issues this could introduce -- it's defintiely more consistent across the board, but I don't have visibility as to why there is a reason char and unsigned char were used where they were. Need advice from @mskucherawy here.
Try this:
sed -i 's/gcc /clang /' configure.ac
Here's the ouput from building the develop branch c73fdd3 on CentOS 8.3 with gcc9 which also shows many -Wpointer-sign warnings. opendmarc_develop_branch_on_EL8_gcc9.txt
Cleaning these up is going to be work and going to require a full walk of the code. I'm targeting this for 1.5.0. 1.4.0 has active CVE's in it that make us want to get a 1.4.1 out soon. But the cleanup will happen before -next.