[问题简述] Anolis8.6 anck x86_64 环境,memcached-1.4.4源码安装,编译失败 [报错信息] make[2]: Entering directory '/root/memcached-1.4.4' gcc -DHAVE_CONFIG_H -I. -DNDEBUG -g -O2 -pthread -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-memcached.o -MD -MP -MF .deps/memcached-memcached.Tpo -c -o memcached-memcached.o `test -f 'memcached.c' || echo './'`memcached.c In file included from memcached.c:16: memcached.c: In function ‘complete_incr_bin’: memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) : 0x0)) ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:1022:48: note: in expansion of macro ‘ITEM_get_cas’ c->binary_header.request.cas == ITEM_get_cas(it))) { ^~~~~~~~~~~~ memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) : 0x0)) ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:1043:22: note: in expansion of macro ‘ITEM_get_cas’ c->cas = ITEM_get_cas(it); ^~~~~~~~~~~~ memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) : 0x0)) ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:1060:26: note: in expansion of macro ‘ITEM_get_cas’ c->cas = ITEM_get_cas(it); ^~~~~~~~~~~~ memcached.c: In function ‘process_bin_get’: memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) : 0x0)) ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:1192:51: note: in expansion of macro ‘ITEM_get_cas’ rsp->message.header.response.cas = htonll(ITEM_get_cas(it)); ^~~~~~~~~~~~ memcached.c: In function ‘process_bin_update’: memcached.h:83:28: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) = v; } } ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:1888:5: note: in expansion of macro ‘ITEM_set_cas’ ITEM_set_cas(it, c->binary_header.request.cas); ^~~~~~~~~~~~ memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) : 0x0)) ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:1904:9: note: in expansion of macro ‘ITEM_get_cas’ if (ITEM_get_cas(it) != 0) { ^~~~~~~~~~~~ memcached.c: In function ‘process_bin_append_prepend’: memcached.h:83:28: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) = v; } } ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:1948:5: note: in expansion of macro ‘ITEM_set_cas’ ITEM_set_cas(it, c->binary_header.request.cas); ^~~~~~~~~~~~ memcached.c: In function ‘process_bin_delete’: memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) : 0x0)) ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:2013:32: note: in expansion of macro ‘ITEM_get_cas’ if (cas == 0 || cas == ITEM_get_cas(it)) { ^~~~~~~~~~~~ memcached.c: In function ‘do_store_item’: memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) : 0x0)) ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:2126:18: note: in expansion of macro ‘ITEM_get_cas’ else if (ITEM_get_cas(it) == ITEM_get_cas(old_it)) { ^~~~~~~~~~~~ memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) : 0x0)) ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:2126:38: note: in expansion of macro ‘ITEM_get_cas’ else if (ITEM_get_cas(it) == ITEM_get_cas(old_it)) { ^~~~~~~~~~~~ memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) : 0x0)) ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:2143:45: note: in expansion of macro ‘ITEM_get_cas’ (unsigned long long)ITEM_get_cas(old_it), ^~~~~~~~~~~~ memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) : 0x0)) ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:2144:45: note: in expansion of macro ‘ITEM_get_cas’ (unsigned long long)ITEM_get_cas(it)); ^~~~~~~~~~~~ memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) : 0x0)) ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:2157:17: note: in expansion of macro ‘ITEM_get_cas’ if (ITEM_get_cas(it) != 0) { ^~~~~~~~~~~~ memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) : 0x0)) ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:2159:21: note: in expansion of macro ‘ITEM_get_cas’ if (ITEM_get_cas(it) != ITEM_get_cas(old_it)) { ^~~~~~~~~~~~ memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) : 0x0)) ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:2159:41: note: in expansion of macro ‘ITEM_get_cas’ if (ITEM_get_cas(it) != ITEM_get_cas(old_it)) { ^~~~~~~~~~~~ memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) : 0x0)) ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:2201:22: note: in expansion of macro ‘ITEM_get_cas’ c->cas = ITEM_get_cas(it); ^~~~~~~~~~~~ memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) : 0x0)) ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:2213:18: note: in expansion of macro ‘ITEM_get_cas’ c->cas = ITEM_get_cas(it); ^~~~~~~~~~~~ memcached.c: In function ‘process_get_command’: memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) : 0x0)) ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:2591:65: note: in expansion of macro ‘ITEM_get_cas’ (unsigned long long)ITEM_get_cas(it)); ^~~~~~~~~~~~ memcached.c: In function ‘process_update_command’: memcached.h:83:28: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) = v; } } ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:2750:5: note: in expansion of macro ‘ITEM_set_cas’ ITEM_set_cas(it, req_cas_id); ^~~~~~~~~~~~ memcached.c: In function ‘do_add_delta’: memcached.h:83:28: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(uint64_t*)&((i)->end[0]) = v; } } ^~~~~~~~~~~~~~~~~~~~~~~~~ memcached.c:2869:9: note: in expansion of macro ‘ITEM_set_cas’ ITEM_set_cas(it, (settings.use_cas) ? get_cas_id() : 0); ^~~~~~~~~~~~ memcached.c: In function ‘main’: memcached.c:4629:13: error: variable ‘udp_port’ set but not used [-Werror=unused-but-set-variable] int udp_port; ^~~~~~~~ cc1: all warnings being treated as errors make[2]: *** [Makefile:431: memcached-memcached.o] Error 1 make[2]: Leaving directory '/root/memcached-1.4.4' make[1]: *** [Makefile:790: all-recursive] Error 1 make[1]: Leaving directory '/root/memcached-1.4.4' make: *** [Makefile:284: all] Error 2 [操作步骤] yum install libevent-devel wget http://memcached.org/files/old/memcached-1.4.4.tar.gz cd memcached-1.4.4 ./configure && make && make test && sudo make install
memcached-1.4.36源码安装,编译也是失败的 [make报错信息] make[3]: Leaving directory '/root/memcached-1.4.36/doc' make[2]: Leaving directory '/root/memcached-1.4.36/doc' make[2]: Entering directory '/root/memcached-1.4.36' gcc -DHAVE_CONFIG_H -I. -DNDEBUG -g -O2 -pthread -pthread -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-memcached.o -MD -MP -MF .deps/memcached-memcached.Tpo -c -o memcached-memcached.o `test -f 'memcached.c' || echo './'`memcached.c memcached.c: In function ‘process_stats_conns.constprop’: memcached.c:3113:33: error: ‘%u’ directive writing between 1 and 5 bytes into a region of size between 1 and 4099 [-Werror=format-overflow=] sprintf(buf, "%s:%s:%u", protoname, addr_text, port); ^~ memcached.c:3113:26: note: directive argument in the range [1, 65535] sprintf(buf, "%s:%s:%u", protoname, addr_text, port); ^~~~~~~~~~ memcached.c:3113:13: note: ‘sprintf’ output between 5 and 4107 bytes into a destination of size 4102 sprintf(buf, "%s:%s:%u", protoname, addr_text, port); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[2]: *** [Makefile:645: memcached-memcached.o] Error 1 make[2]: Leaving directory '/root/memcached-1.4.36' make[1]: *** [Makefile:1176: all-recursive] Error 1 make[1]: Leaving directory '/root/memcached-1.4.36' make: *** [Makefile:464: all] Error 2 [root@8-6-anck memcached-1.4.36]# memcached-1.4.36 [复现步骤] wget http://www.memcached.org/files/memcached-1.4.36.tar.gz tar xvf memcached-1.4.36.tar.gz cd memcached-1.4.36 /configure && make && make test && sudo make instal 注意:make阶段编译失败