[jira] [Commented] (TS-1586) spdy plugin doesn't build under clang (from trunk)

2013-04-19 Thread JIRA

[ 
https://issues.apache.org/jira/browse/TS-1586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13636726#comment-13636726
 ] 

Igor Galić commented on TS-1586:


First off, the patch that I submitted makes __restrict conform to more or less 
documented way it's supposed to be used: 
http://gcc.gnu.org/onlinedocs/gcc/Restricted-Pointers.html -- also note, this 
is a G++ specific extension. restrict does not exist in C++.

Second, the error message, 
{noformat}/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/bits/stl_iterator_base_funcs.h:174:49:
 error: no type named 'difference_type' in
  'std::iterator_traitsconst unsigned char *restrict'
  typename iterator_traits_InputIterator::difference_type __d = 
__n;{noformat}

suggests to me that we simply need a template for this, perhaps [~amc] can 
chip in here with his mad C++ skillz.

 spdy plugin doesn't build under clang (from trunk)
 --

 Key: TS-1586
 URL: https://issues.apache.org/jira/browse/TS-1586
 Project: Traffic Server
  Issue Type: Bug
  Components: Build, Plugins
Affects Versions: 3.3.1
 Environment: Linux with llvm/clang from trunk + libstc++
 (I don't have libc++ on Linux)
Reporter: Igor Galić
Assignee: Igor Galić
 Fix For: 3.3.3

 Attachments: restrict.patch, swap_restrict.patch


 {noformat}
 Making all in spdy
 gmake[3]: Entering directory 
 `/home/igalic/src/asf/trafficserver/CLANG/plugins/experimental/spdy'
 /bin/sh ../../../libtool  --tag=CXX   --mode=compile clang++ -DHAVE_CONFIG_H 
 -I. -I../../../../plugins/experimental/spdy -I../../../lib/ts  
 -I../../../../plugins/experimental/spdy/lib -I../../../proxy/api 
 -D__STDC_FORMAT_MACROS=1 -D_LARGEFILE64_SOURCE=1 -D_COMPILE64BIT_SOURCE=1 
 -D_GNU_SOURCE -D_REENTRANT -Dlinux -DDEBUG -D_DEBUG  -std=c++11 -ggdb3 
 -Werror -Qunused-arguments -Wno-invalid-offsetof -MT message.lo -MD -MP -MF 
 .deps/message.Tpo -c -o message.lo `test -f 'lib/spdy/message.cc' || echo 
 '../../../../plugins/experimental/spdy/'`lib/spdy/message.cc
 libtool: compile:  clang++ -DHAVE_CONFIG_H -I. 
 -I../../../../plugins/experimental/spdy -I../../../lib/ts 
 -I../../../../plugins/experimental/spdy/lib -I../../../proxy/api 
 -D__STDC_FORMAT_MACROS=1 -D_LARGEFILE64_SOURCE=1 -D_COMPILE64BIT_SOURCE=1 
 -D_GNU_SOURCE -D_REENTRANT -Dlinux -DDEBUG -D_DEBUG -std=c++11 -ggdb3 -Werror 
 -Qunused-arguments -Wno-invalid-offsetof -MT message.lo -MD -MP -MF 
 .deps/message.Tpo -c 
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc  -fPIC -DPIC -o 
 .libs/message.o
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:72:23: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 extract(const uint8_t __restrict * ptr) {
 ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:80:32: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 extractuint8_t(const uint8_t __restrict * ptr) {
  ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:85:30: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 insert(const T val, uint8_t __restrict * ptr) {
  ^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:91:33: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 extract_stream_id(const uint8_t __restrict * ptr)
   ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:97:46: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 insert_stream_id(uint32_t stream_id, uint8_t __restrict * ptr)
  ^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:104:23: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 const uint8_t __restrict * ptr, size_t len)
 ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:133:44: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 const message_header msg, uint8_t __restrict * ptr, size_t len)
^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:153:23: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 const uint8_t __restrict * ptr, size_t len)
 ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:170:23: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned 

[jira] [Commented] (TS-1586) spdy plugin doesn't build under clang (from trunk)

2013-04-19 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-1586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13637107#comment-13637107
 ] 

ASF subversion and git services commented on TS-1586:
-

Commit 270edbe704bc3d69b56026d8d54e0f16891cb649 in branch refs/heads/master 
from [~jpe...@apache.org]
[ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=270edbe ]

TS-1586: Fix the SPDY plugin build under clang on Linux.


 spdy plugin doesn't build under clang (from trunk)
 --

 Key: TS-1586
 URL: https://issues.apache.org/jira/browse/TS-1586
 Project: Traffic Server
  Issue Type: Bug
  Components: Build, Plugins
Affects Versions: 3.3.1
 Environment: Linux with llvm/clang from trunk + libstc++
 (I don't have libc++ on Linux)
Reporter: Igor Galić
Assignee: Igor Galić
 Fix For: 3.3.3

 Attachments: restrict.patch, swap_restrict.patch


 {noformat}
 Making all in spdy
 gmake[3]: Entering directory 
 `/home/igalic/src/asf/trafficserver/CLANG/plugins/experimental/spdy'
 /bin/sh ../../../libtool  --tag=CXX   --mode=compile clang++ -DHAVE_CONFIG_H 
 -I. -I../../../../plugins/experimental/spdy -I../../../lib/ts  
 -I../../../../plugins/experimental/spdy/lib -I../../../proxy/api 
 -D__STDC_FORMAT_MACROS=1 -D_LARGEFILE64_SOURCE=1 -D_COMPILE64BIT_SOURCE=1 
 -D_GNU_SOURCE -D_REENTRANT -Dlinux -DDEBUG -D_DEBUG  -std=c++11 -ggdb3 
 -Werror -Qunused-arguments -Wno-invalid-offsetof -MT message.lo -MD -MP -MF 
 .deps/message.Tpo -c -o message.lo `test -f 'lib/spdy/message.cc' || echo 
 '../../../../plugins/experimental/spdy/'`lib/spdy/message.cc
 libtool: compile:  clang++ -DHAVE_CONFIG_H -I. 
 -I../../../../plugins/experimental/spdy -I../../../lib/ts 
 -I../../../../plugins/experimental/spdy/lib -I../../../proxy/api 
 -D__STDC_FORMAT_MACROS=1 -D_LARGEFILE64_SOURCE=1 -D_COMPILE64BIT_SOURCE=1 
 -D_GNU_SOURCE -D_REENTRANT -Dlinux -DDEBUG -D_DEBUG -std=c++11 -ggdb3 -Werror 
 -Qunused-arguments -Wno-invalid-offsetof -MT message.lo -MD -MP -MF 
 .deps/message.Tpo -c 
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc  -fPIC -DPIC -o 
 .libs/message.o
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:72:23: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 extract(const uint8_t __restrict * ptr) {
 ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:80:32: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 extractuint8_t(const uint8_t __restrict * ptr) {
  ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:85:30: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 insert(const T val, uint8_t __restrict * ptr) {
  ^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:91:33: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 extract_stream_id(const uint8_t __restrict * ptr)
   ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:97:46: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 insert_stream_id(uint32_t stream_id, uint8_t __restrict * ptr)
  ^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:104:23: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 const uint8_t __restrict * ptr, size_t len)
 ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:133:44: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 const message_header msg, uint8_t __restrict * ptr, size_t len)
^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:153:23: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 const uint8_t __restrict * ptr, size_t len)
 ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:170:23: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 const uint8_t __restrict * ptr, size_t len)
 ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:185:23: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 const uint8_t __restrict * ptr, size_t len)
 ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:200:48: 

[jira] [Commented] (TS-1586) spdy plugin doesn't build under clang (from trunk)

2013-03-27 Thread JIRA

[ 
https://issues.apache.org/jira/browse/TS-1586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13615747#comment-13615747
 ] 

Igor Galić commented on TS-1586:


updated description and environment to reflect this:

Can't use libc++ yet - not without pain: http://libcxx.llvm.org/

 spdy plugin doesn't build under clang (from trunk)
 --

 Key: TS-1586
 URL: https://issues.apache.org/jira/browse/TS-1586
 Project: Traffic Server
  Issue Type: Bug
  Components: Build, Plugins
Affects Versions: 3.3.1
 Environment: Linux with llvm/clang from trunk + libstc++
 (I don't have libc++ on Linux)
Reporter: Igor Galić
Assignee: Igor Galić
 Fix For: 3.3.2

 Attachments: restrict.patch, swap_restrict.patch


 {noformat}
 Making all in spdy
 gmake[3]: Entering directory 
 `/home/igalic/src/asf/trafficserver/CLANG/plugins/experimental/spdy'
 /bin/sh ../../../libtool  --tag=CXX   --mode=compile clang++ -DHAVE_CONFIG_H 
 -I. -I../../../../plugins/experimental/spdy -I../../../lib/ts  
 -I../../../../plugins/experimental/spdy/lib -I../../../proxy/api 
 -D__STDC_FORMAT_MACROS=1 -D_LARGEFILE64_SOURCE=1 -D_COMPILE64BIT_SOURCE=1 
 -D_GNU_SOURCE -D_REENTRANT -Dlinux -DDEBUG -D_DEBUG  -std=c++11 -ggdb3 
 -Werror -Qunused-arguments -Wno-invalid-offsetof -MT message.lo -MD -MP -MF 
 .deps/message.Tpo -c -o message.lo `test -f 'lib/spdy/message.cc' || echo 
 '../../../../plugins/experimental/spdy/'`lib/spdy/message.cc
 libtool: compile:  clang++ -DHAVE_CONFIG_H -I. 
 -I../../../../plugins/experimental/spdy -I../../../lib/ts 
 -I../../../../plugins/experimental/spdy/lib -I../../../proxy/api 
 -D__STDC_FORMAT_MACROS=1 -D_LARGEFILE64_SOURCE=1 -D_COMPILE64BIT_SOURCE=1 
 -D_GNU_SOURCE -D_REENTRANT -Dlinux -DDEBUG -D_DEBUG -std=c++11 -ggdb3 -Werror 
 -Qunused-arguments -Wno-invalid-offsetof -MT message.lo -MD -MP -MF 
 .deps/message.Tpo -c 
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc  -fPIC -DPIC -o 
 .libs/message.o
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:72:23: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 extract(const uint8_t __restrict * ptr) {
 ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:80:32: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 extractuint8_t(const uint8_t __restrict * ptr) {
  ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:85:30: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 insert(const T val, uint8_t __restrict * ptr) {
  ^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:91:33: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 extract_stream_id(const uint8_t __restrict * ptr)
   ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:97:46: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 insert_stream_id(uint32_t stream_id, uint8_t __restrict * ptr)
  ^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:104:23: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 const uint8_t __restrict * ptr, size_t len)
 ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:133:44: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 const message_header msg, uint8_t __restrict * ptr, size_t len)
^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:153:23: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 const uint8_t __restrict * ptr, size_t len)
 ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:170:23: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 const uint8_t __restrict * ptr, size_t len)
 ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:185:23: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 const uint8_t __restrict * ptr, size_t len)
 ~~^~
 ../../../../plugins/experimental/spdy/lib/spdy/message.cc:200:48: error: 
 restrict requires a pointer or reference ('uint8_t' (aka 'unsigned char') is 
 invalid)
 const rst_stream_message msg, uint8_t __restrict *