FreeBSD dropped `const` in base r303451 and made the argument mutable in base r308264. Vendor makefile contains -std=c99 which leads to the following error src/cli.c:385:9: error: generic selections are a C11-specific feature [-Werror,-Wc11-extensions] appl = basename(pwd); ^ /usr/include/libgen.h:60:21: note: expanded from macro 'basename' #define basename(x) __generic(x, const char *, __old_basename, basename)(x) ^ /usr/include/sys/cdefs.h:337:2: note: expanded from macro '__generic' _Generic(expr, t: yes, default: no) ^
Be sure to change the vendor's Makefile to use -std=gnu99 instead. :-)
(In reply to Ed Schouten from comment #1) > ... use -std=gnu99 instead Not enough at least for Clang 3.9. However, -std=c11 works fine.
Created attachment 177182 [details] kore.diff I currently see three ways to fix this, but I'm unsure which one is the correct one: (1) Add #undef basename to src/cli.c, so that it always uses the new basename without having to use _Generic (2) Add -Wno-error=c11-extensions to CFLAGS. This breaks the build with gcc (since it doesn't know about -Wno-error) and on FreeBSD 9.3, but at least we don't just silence the warning. Building on FreeBSD 9.3 could be fixed by building with clang from ports, but I'm more inclined to just mark it broken. (3) Use -std=c11 instead of -std=c99. I'm unsure what -std=c11 actually implies, probably more than just -Wno-c11-extensions. I'm leaning towards (2) and the patch is for that approach. It should also fix building with clang 3.9 (bug #214639).
A commit references this bug: Author: jbeich Date: Sun Nov 20 20:58:21 UTC 2016 New revision: 426629 URL: https://svnweb.freebsd.org/changeset/ports/426629 Log: devel/kore: unbreak build on 12.0 src/cli.c:385:9: error: generic selections are a C11-specific feature [-Werror,-Wc11-extensions] appl = basename(pwd); ^ /usr/include/libgen.h:60:21: note: expanded from macro 'basename' #define basename(x) __generic(x, const char *, __old_basename, basename)(x) ^ /usr/include/sys/cdefs.h:337:2: note: expanded from macro '__generic' _Generic(expr, t: yes, default: no) ^ PR: 214638 Reported by: pkg-fallout Submitted by: Tobias Kortkamp <t@tobik.me> (maintainer) Changes: head/devel/kore/Makefile
A commit references this bug: Author: jbeich Date: Sun Feb 5 18:58:19 UTC 2017 New revision: 433446 URL: https://svnweb.freebsd.org/changeset/ports/433446 Log: devel/kore: unbreak with GCC after r426629 cc1: error: -Werror=c11-extensions: no option -Wc11-extensions PR: 214638 Reported by: marino, pkg-fallout (mips, mips64) Changes: head/devel/kore/Makefile