Inspired by Timo Aaltonen's patch and SSSD's build aliases, I've added CFLAGS="-Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wformat-security" to my build. There are 3 more warnings we might want to fix:
CFLAGS="-Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wformat-security"
All these are in sentinel values, for example:
static const struct { const char *algo; CK_MECHANISM_TYPE mech; } algo2mech[] = { ... { "sha512", CKM_SHA512_HMAC }, { } // <- warning here };
We'll want to add these, and -Werror, to our Makefile.
-Werror
We might want to disable -Wmissing-field-initializers, see this mail: http://www.redhat.com/archives/freeipa-devel/2013-September/msg00378.html
-Wmissing-field-initializers
With the recent hardened build patch, it's apparently not possible to add custom CFLAGS to make rpms in a way that the hardening flags are used as well.
make rpms
We'll want to add the warning flags (and possibly -Werror) to the upstream Makefile, or find a way to specify additional CFLAGS.
The build will now fail if any of the mentioned the mentioned warnings, except -Wmissing-field-initializers, are triggered.
master: 5e2f7b6
Metadata Update from @pviktori: - Issue assigned to jcholast - Issue set to the milestone: FreeIPA 4.0 - 2013/11
Log in to comment on this ticket.