make check fail in current 2.1.5 release candidate
--------------------------------------------------

                 Key: TS-627
                 URL: https://issues.apache.org/jira/browse/TS-627
             Project: Traffic Server
          Issue Type: Bug
          Components: Build
    Affects Versions: 2.1.5
         Environment: gcc version 4.4.5 (Debian 4.4.5-8) 

            Reporter: Arno Toell
            Priority: Trivial
             Fix For: 2.1.6


gcc refueses to build the test_freelist.cc tests due to an incompatible cast:
{noformat} 
 # make -j1 check
 make[4]: Entering directory 
`/root/trafficserver/trafficserver-2.1.5-unstable/lib/ts'
 g++ -DHAVE_CONFIG_H -I.   -D_LARGEFILE64_SOURCE=1 -D_COMPILE64BIT_SOURCE=1 
-D_GNU_SOURCE -D_REENTRANT -Dlinux -I/usr/include  /tcl8.4  -g -O2 -pipe -Wall 
-Werror -O3 -feliminate-unused-debug-symbols -fno-strict-aliasing 
-Wno-invalid-offsetof -c -o test_atomic.o test_atomic.cc 
 /bin/bash ../../libtool --tag=CXX   --mode=link g++  -g -O2 -pipe -Wall 
-Werror -O3 -feliminate-unused-debug-symbols -fno-strict-aliasing 
-Wno-invalid-offsetof -rdynamic  -o test_atomic test_atomic.o libts.a -lpthread 
-ltcl8.4   -lz
libtool: link: g++ -g -O2 -pipe -Wall -Werror -O3 
-feliminate-unused-debug-symbols -fno-strict-aliasing -Wno-invalid-offsetof 
-rdynamic -o test_atomic  test_atomic.o  libts.a -lpthread -ltcl8.4 -lz
 g++ -DHAVE_CONFIG_H -I.   -D_LARGEFILE64_SOURCE=1 -D_COMPILE64BIT_SOURCE=1 
-D_GNU_SOURCE -D_REENTRANT -Dlinux -I/usr/include/tcl8.4  -g -O2 -pipe -Wall 
-Werror -O3 -feliminate-unused-debug-symbols -fno-strict-aliasing 
-Wno-invalid-offsetof -c -o test_freelist.o test_freelist.cc
 cc1plus: warnings being treated as errors
 test_freelist.cc: In function 'void* test(void*)':
 test_freelist.cc:53: error: format '%08llx' expects type 'long long unsigned 
int', but argument 2 has type 'uintptr_t'
 ...
{noformat} 

A dirty cast fixes this issue:

{noformat} 
--- trafficserver-2.1.5-unstable.orig/lib/ts/test_freelist.cc   2011-01-08 
23:19:52.991320400 +0100
+++ trafficserver-2.1.5-unstable/lib/ts/test_freelist.cc        2011-01-08 
23:22:47.407321018 +0100
@@ -50,7 +50,7 @@
     m3 = ink_freelist_new(flist);

     if ((m1 == m2) || (m1 == m3) || (m2 == m3)) {
-      printf("0x%08llx   0x%08llx   0x%08llx\n", (uint64_t)(uintptr_t) m1, 
(uint64_t)(uintptr_t) m2, (uint64_t)(uintptr_t) m3);
+      printf("0x%08llx   0x%08llx   0x%08llx\n", static_cast<long long 
unsigned int>((uint64_t)(uintptr_t) m1),  static_cast<long long unsigned 
int>((uint64_t)(uintptr_t) m2),  static_cast<long long unsigned 
int>((uint64_t)(uintptr_t) m3));
       exit(1);
     }
{noformat} 

perhaps you want do it more clean though ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to