src/pgsql.c:222:17: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs] va_start(args, count); ^ src/pgsql.c:217:45: note: parameter of type 'u_int8_t' (aka 'unsigned char') is declared here const char *query, int result, u_int8_t count, ...) ^ http://package18.nyi.freebsd.org/data/headi386PR212343-default/2016-09-11_07h04m19s/logs/errors/kore-2.0.0.log To reproduce without upgrading to /projects/clang390-import try $ pkg install -y llvm39 $ CC=clang39 CXX=clang++39 CPP=clang-cpp39 make clean all
I've opened an upstream issue: https://github.com/jorisvink/kore/issues/153
The issue has been fixed upstream: https://github.com/jorisvink/kore/commit/7eced6f035c83c02680d9b58371851f8662a0e8a I've included a backport of the fix in the patch attached to bug #214638.
A commit references this bug: Author: jbeich Date: Sun Nov 20 20:58:38 UTC 2016 New revision: 426630 URL: https://svnweb.freebsd.org/changeset/ports/426630 Log: devel/kore: unbreak build with clang 3.9 src/pgsql.c:222:17: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs] va_start(args, count); ^ src/pgsql.c:217:45: note: parameter of type 'u_int8_t' (aka 'unsigned char') is declared here const char *query, int result, u_int8_t count, ...) ^ PR: 214639 Reported by: antoine (via exp-run) Submitted by: Tobias Kortkamp <t@tobik.me> (maintainer) Obtained from: upstream Changes: head/devel/kore/Makefile head/devel/kore/files/patch-includes_pgsql.h head/devel/kore/files/patch-src_pgsql.c
well, unfortunately one man's fix is another man's breakage. This fix breaks gcc compilers. Can this fix be reworked to avoid the gcc regression? -------------------------------------------------------------------------------- -- Phase: build -------------------------------------------------------------------------------- ===> Building for kore-2.0.0_1 gmake[1]: Entering directory '/construction/devel/kore/kore-2.0.0-release' cc -pipe -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -Iincludes -std=c99 -pedantic -Wno-error=c11-extensions -DPREFIX='"/usr/local"' -I/usr/local/include -DKORE_USE_PGSQL -DPGSQL_INCLUDE_PATH="\"/usr/local/include\"" -DKORE_USE_TASKS -DKORE_USE_JSONRPC -I/usr/local/include -c src/kore.c -o obj/kore.o cc -pipe -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -Iincludes -std=c99 -pedantic -Wno-error=c11-extensions -DPREFIX='"/usr/local"' -I/usr/local/include -DKORE_USE_PGSQL -DPGSQL_INCLUDE_PATH="\"/usr/local/include\"" -DKORE_USE_TASKS -DKORE_USE_JSONRPC -I/usr/local/include -c src/buf.c -o obj/buf.o cc1: error: -Werror=c11-extensions: no option -Wc11-extensions cc1: error: -Werror=c11-extensions: no option -Wc11-extensions gmake[1]: *** [Makefile:106: obj/kore.o] Error 1 gmake[1]: *** Waiting for unfinished jobs.... gmake[1]: *** [Makefile:106: obj/buf.o] Error 1
Created attachment 177921 [details] kore.diff (In reply to John Marino from comment #4) Ah... I added -Wno-error=c11-extensions because of bug 214638. In hindsight knowingly adding a clang only option is pretty bad. Using -Wno-c11-extensions instead should fix the build with gcc.
Comment on attachment 177921 [details] kore.diff The patch failed to fix build with GCC, so I've landed my own in ports r433446. Besides, having -Werror downstream is a recipe for churn: $ pkg install gcc7-devel $ make clean all CC=gcc7 CXX=g++7 CPP=cpp7 CHOSEN_COMPILER_TYPE=gcc [...] src/http.c: In function 'http_header_recv': src/http.c:597:50: error: comparison between pointer and zero character constant [-Werror=pointer-compare] strncasecmp(host[0], "host", 4) || host[1] == '\0') { ^~ src/http.c:597:42: note: did you mean to dereference the pointer? strncasecmp(host[0], "host", 4) || host[1] == '\0') { ^