(In reply to Steve Wills from comment #9 Bug 202590 which was "Fixed" and closed) I've built memcached successfully on FreeBSD10.2Stable i386, but not on amd64. Both using ccache. With the exception of -march the settings and scripts are identical. Compiler used is clang 3.4.1 # cc -v FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 The kernel,world,distribution were rebuilt/installed yesterday, ports today. Updated /usr/ports and commenced a FULL ports rebuild. After the amd64 failure, the ccache was cleared as a precaution. Retry resulted in: make -DBATCH -DUSE_CORE2 package ===> Building for memcached-1.4.24_2 /usr/bin/make all-recursive Making all in doc /usr/bin/make all-am /usr/local/libexec/ccache/cc -DHAVE_CONFIG_H -I. -I/usr/local/include -O2 -pipe -g0 -ggdb0 -DSTRIP_FBSDID -march=core-avx-i -I/usr/local/include -fno-strict-aliasing -std=c99 -m64 -O2 -pipe -g0 -ggdb0 -DSTRIP_FBSDID -march=core-avx-i -I/usr/local/include -fno-strict-aliasing -std=c99 -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached_debug-items.o -MD -MP -MF .deps/memcached_debug-items.Tpo -c -o memcached_debug-items.o `test -f 'items.c' || echo './'`items.c items.c:1141:28: error: comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Werror,-Wtautological-constant-out-of-range-compare] assert(it->slabs_clsid < LARGEST_ID); ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~ /usr/include/assert.h:54:21: note: expanded from macro 'assert' #define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \ ^ 1 error generated. *** Error code 1 FYI: 717 packages are successfully built on i386, and memcached-1.4.24.txz was last successfully built on Jul 22 23:32
Either disable ccache or set the CCACHE_CPP2 environment variable during your build.
Turning ccache off only transforms that into: items.c:1141:28: warning: comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Wtautological-constant-out-of-range-compare] assert(it->slabs_clsid < LARGEST_ID); ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~ /usr/include/assert.h:54:21: note: expanded from macro 'assert' #define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \ ^ 1 warning generated. Already should be fixed upstream though, yet the highlighted line was probably forgotten: https://github.com/memcached/memcached/commit/f0358c023e79d0ffc320222afe8a978f528e52a3
(In reply to c.kworr from comment #2) I see the assert and agree that the fix is probably to simply remove it, but what I don't understand is why the issue is an error for you and only a warning in my build. Any ideas?
(In reply to c.kworr from comment #2) I noticed too that in the initial bug report it was an error, but in comment 2 it shows as only a warning.
ccache it is: # without CCACHE_CPP2 clang37 -DHAVE_CONFIG_H -I. -I/usr/local/include -m64 -O3 -pipe -march=native -fstack-protector -fno-strict-aliasing -std=c99 -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached_debug-slabs.o -MD -MP -MF .deps/memcached_debug-slabs.Tpo -c -o memcached_debug-slabs.o `test -f 'slabs.c' || echo './'`slabs.c mv -f .deps/memcached_debug-slabs.Tpo .deps/memcached_debug-slabs.Po clang37 -DHAVE_CONFIG_H -I. -I/usr/local/include -m64 -O3 -pipe -march=native -fstack-protector -fno-strict-aliasing -std=c99 -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached_debug-items.o -MD -MP -MF .deps/memcached_debug-items.Tpo -c -o memcached_debug-items.o `test -f 'items.c' || echo './'`items.c items.c:1141:28: error: comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Werror,-Wtautological-constant-out-of-range-compare] assert(it->slabs_clsid < LARGEST_ID); ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~ /usr/include/assert.h:54:21: note: expanded from macro 'assert' #define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \ ^ 1 error generated. *** Error code 1 # with CCACHE_CPP2 clang37 -DHAVE_CONFIG_H -I. -I/usr/local/include -m64 -O3 -pipe -march=native -fstack-protector -fno-strict-aliasing -std=c99 -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached_debug-slabs.o -MD -MP -MF .deps/memcached_debug-slabs.Tpo -c -o memcached_debug-slabs.o `test -f 'slabs.c' || echo './'`slabs.c mv -f .deps/memcached_debug-slabs.Tpo .deps/memcached_debug-slabs.Po clang37 -DHAVE_CONFIG_H -I. -I/usr/local/include -m64 -O3 -pipe -march=native -fstack-protector -fno-strict-aliasing -std=c99 -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached_debug-items.o -MD -MP -MF .deps/memcached_debug-items.Tpo -c -o memcached_debug-items.o `test -f 'items.c' || echo './'`items.c items.c:1141:28: warning: comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Wtautological-constant-out-of-range-compare] assert(it->slabs_clsid < LARGEST_ID); ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~ /usr/include/assert.h:54:21: note: expanded from macro 'assert' #define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \ ^ 1 warning generated. It ends up adding -Werror from somewhere.
A commit references this bug: Author: swills Date: Tue Oct 27 18:01:29 UTC 2015 New revision: 400333 URL: https://svnweb.freebsd.org/changeset/ports/400333 Log: databases/memcached: fix build with ccache on 64bit systems PR: 203219 Changes: head/databases/memcached/files/patch-items.c
Fixed, please let me know if you are still experiencing issues.