<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.openanolis.cn/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.openanolis.cn/"
          
          maintainer="service@openanolis.org"
>

    <bug>
          <bug_id>1621</bug_id>
          
          <creation_ts>2022-07-05 16:11:22 +0000</creation_ts>
          <short_desc>[Anolis8.6][anck][x86_64][memcached兼容性] memcached-1.4.4源码编译报错</short_desc>
          <delta_ts>2022-07-05 16:21:33 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Anolis OS</classification>
          <product>Anolis OS 8</product>
          <component>Others</component>
          <version>8.6</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3-Medium</priority>
          <bug_severity>S3-normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="anolislw">wb-lw533035</reporter>
          <assigned_to name="葛立伟">liwei.glw</assigned_to>
          
          
          <qa_contact name="shuming">qingming.su</qa_contact>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>5266</commentid>
    <comment_count>0</comment_count>
    <who name="anolislw">wb-lw533035</who>
    <bug_when>2022-07-05 16:11:22 +0000</bug_when>
    <thetext>[问题简述]
Anolis8.6 anck x86_64 环境,memcached-1.4.4源码安装，编译失败

[报错信息]
make[2]: Entering directory &apos;/root/memcached-1.4.4&apos;
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 &apos;memcached.c&apos; || echo &apos;./&apos;`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*)&amp;((i)-&gt;end[0]) : 0x0))
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~
memcached.c:1022:48: note: in expansion of macro ‘ITEM_get_cas’
                c-&gt;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*)&amp;((i)-&gt;end[0]) : 0x0))
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~
memcached.c:1043:22: note: in expansion of macro ‘ITEM_get_cas’
             c-&gt;cas = ITEM_get_cas(it);
                      ^~~~~~~~~~~~
memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
                                     *(uint64_t*)&amp;((i)-&gt;end[0]) : 0x0))
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~
memcached.c:1060:26: note: in expansion of macro ‘ITEM_get_cas’
                 c-&gt;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*)&amp;((i)-&gt;end[0]) : 0x0))
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~
memcached.c:1192:51: note: in expansion of macro ‘ITEM_get_cas’
         rsp-&gt;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*)&amp;((i)-&gt;end[0]) = v; } }
                            ^~~~~~~~~~~~~~~~~~~~~~~~~
memcached.c:1888:5: note: in expansion of macro ‘ITEM_set_cas’
     ITEM_set_cas(it, c-&gt;binary_header.request.cas);
     ^~~~~~~~~~~~
memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
                                     *(uint64_t*)&amp;((i)-&gt;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*)&amp;((i)-&gt;end[0]) = v; } }
                            ^~~~~~~~~~~~~~~~~~~~~~~~~
memcached.c:1948:5: note: in expansion of macro ‘ITEM_set_cas’
     ITEM_set_cas(it, c-&gt;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*)&amp;((i)-&gt;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*)&amp;((i)-&gt;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*)&amp;((i)-&gt;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*)&amp;((i)-&gt;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*)&amp;((i)-&gt;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*)&amp;((i)-&gt;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*)&amp;((i)-&gt;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*)&amp;((i)-&gt;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*)&amp;((i)-&gt;end[0]) : 0x0))
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~
memcached.c:2201:22: note: in expansion of macro ‘ITEM_get_cas’
             c-&gt;cas = ITEM_get_cas(it);
                      ^~~~~~~~~~~~
memcached.h:81:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
                                     *(uint64_t*)&amp;((i)-&gt;end[0]) : 0x0))
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~
memcached.c:2213:18: note: in expansion of macro ‘ITEM_get_cas’
         c-&gt;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*)&amp;((i)-&gt;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*)&amp;((i)-&gt;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*)&amp;((i)-&gt;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 &apos;/root/memcached-1.4.4&apos;
make[1]: *** [Makefile:790: all-recursive] Error 1
make[1]: Leaving directory &apos;/root/memcached-1.4.4&apos;
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 &amp;&amp; make &amp;&amp; make test &amp;&amp; sudo make install</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5269</commentid>
    <comment_count>1</comment_count>
    <who name="anolislw">wb-lw533035</who>
    <bug_when>2022-07-05 16:21:33 +0000</bug_when>
    <thetext>memcached-1.4.36源码安装，编译也是失败的
[make报错信息]
make[3]: Leaving directory &apos;/root/memcached-1.4.36/doc&apos;
make[2]: Leaving directory &apos;/root/memcached-1.4.36/doc&apos;
make[2]: Entering directory &apos;/root/memcached-1.4.36&apos;
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 &apos;memcached.c&apos; || echo &apos;./&apos;`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, &quot;%s:%s:%u&quot;, protoname, addr_text, port);
                                 ^~
memcached.c:3113:26: note: directive argument in the range [1, 65535]
             sprintf(buf, &quot;%s:%s:%u&quot;, protoname, addr_text, port);
                          ^~~~~~~~~~
memcached.c:3113:13: note: ‘sprintf’ output between 5 and 4107 bytes into a destination of size 4102
             sprintf(buf, &quot;%s:%s:%u&quot;, protoname, addr_text, port);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:645: memcached-memcached.o] Error 1
make[2]: Leaving directory &apos;/root/memcached-1.4.36&apos;
make[1]: *** [Makefile:1176: all-recursive] Error 1
make[1]: Leaving directory &apos;/root/memcached-1.4.36&apos;
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 &amp;&amp; make &amp;&amp; make test &amp;&amp; sudo make instal
注意：make阶段编译失败</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>