Traffic Server
  1. Traffic Server
  2. TS-1116

Fix build issues with clang (particularly on OSX)

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.4, 3.0.3
    • Fix Version/s: 3.1.3, 3.0.5
    • Component/s: None
    • Labels:
      None
    • Backport to Version:

      Description

      We should get it to compile with clang again, specially since on OSX, clang is the 'future'.

      1. TS-1116.diff
        4 kB
        Leif Hedstrom

        Activity

        Leif Hedstrom created issue -
        Hide
        Leif Hedstrom added a comment -

        I got most of it to compile, with the exception of this in IpMap.cc:

        IpMap.cc:850:11: error: call to function 'operator<' that is neither visible in the template definition nor found by argument-dependent lookup
            if (x < n->_min) n = left(n);
                  ^
        IpMap.cc:1236:24: note: in instantiation of member function 'ts::detail::IpMapBase<ts::detail::Ip6Node>::contains' requested here
            zret = _m6 && _m6->contains(ink_inet_ip6_cast(target), ptr);
                               ^
        IpMap.cc:1164:13: note: 'operator<' should be declared prior to the call site or in the global namespace
        inline bool operator<(sockaddr_in6 const* lhs, sockaddr_in6 const& rhs) {
                    ^
        IpMap.cc:665:17: error: call to function 'operator==' that is neither visible in the template definition nor found by argument-dependent lookup
            if (n->_min == min) {
                        ^
        IpMap.cc:1260:21: note: in instantiation of member function 'ts::detail::IpMapBase<ts::detail::Ip6Node>::mark' requested here
            this->force6()->mark(ink_inet_ip6_cast(min), ink_inet_ip6_cast(max), data);
                            ^
        IpMap.cc:1172:13: note: 'operator==' should be declared prior to the call site or in the global namespace
        inline bool operator==(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
                    ^
        IpMap.cc:736:19: error: call to function 'operator<=' that is neither visible in the template definition nor found by argument-dependent lookup
              if (n->_max <= max_plus) { // completely covered, drop span, continue
                          ^
        IpMap.cc:1188:13: note: 'operator<=' should be declared prior to the call site or in the global namespace
        inline bool operator<=(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
                    ^
        IpMap.cc:514:16: error: call to function 'operator<' that is neither visible in the template definition nor found by argument-dependent lookup
            if (target < n->_min) n = left(n);
                       ^
        IpMap.cc:640:16: note: in instantiation of member function 'ts::detail::IpMapBase<ts::detail::Ip6Node>::lowerBound' requested here
          N* n = this->lowerBound(min); // current node.
                       ^
        IpMap.cc:1260:21: note: in instantiation of member function 'ts::detail::IpMapBase<ts::detail::Ip6Node>::mark' requested here
            this->force6()->mark(ink_inet_ip6_cast(min), ink_inet_ip6_cast(max), data);
                            ^
        IpMap.cc:1164:13: note: 'operator<' should be declared prior to the call site or in the global namespace
        inline bool operator<(sockaddr_in6 const* lhs, sockaddr_in6 const& rhs) {
                    ^
        4 errors generated.
        

        I'll commit the other changes (after I test them on Linux), but I'll need assistant from some C++ propeller head with the template madness above .

        Show
        Leif Hedstrom added a comment - I got most of it to compile, with the exception of this in IpMap.cc: IpMap.cc:850:11: error: call to function ' operator <' that is neither visible in the template definition nor found by argument-dependent lookup if (x < n->_min) n = left(n); ^ IpMap.cc:1236:24: note: in instantiation of member function 'ts::detail::IpMapBase<ts::detail::Ip6Node>::contains' requested here zret = _m6 && _m6->contains(ink_inet_ip6_cast(target), ptr); ^ IpMap.cc:1164:13: note: ' operator <' should be declared prior to the call site or in the global namespace inline bool operator <(sockaddr_in6 const * lhs, sockaddr_in6 const & rhs) { ^ IpMap.cc:665:17: error: call to function ' operator ==' that is neither visible in the template definition nor found by argument-dependent lookup if (n->_min == min) { ^ IpMap.cc:1260:21: note: in instantiation of member function 'ts::detail::IpMapBase<ts::detail::Ip6Node>::mark' requested here this ->force6()->mark(ink_inet_ip6_cast(min), ink_inet_ip6_cast(max), data); ^ IpMap.cc:1172:13: note: ' operator ==' should be declared prior to the call site or in the global namespace inline bool operator ==(sockaddr_in6 const & lhs, sockaddr_in6 const * rhs) { ^ IpMap.cc:736:19: error: call to function ' operator <=' that is neither visible in the template definition nor found by argument-dependent lookup if (n->_max <= max_plus) { // completely covered, drop span, continue ^ IpMap.cc:1188:13: note: ' operator <=' should be declared prior to the call site or in the global namespace inline bool operator <=(sockaddr_in6 const & lhs, sockaddr_in6 const & rhs) { ^ IpMap.cc:514:16: error: call to function ' operator <' that is neither visible in the template definition nor found by argument-dependent lookup if (target < n->_min) n = left(n); ^ IpMap.cc:640:16: note: in instantiation of member function 'ts::detail::IpMapBase<ts::detail::Ip6Node>::lowerBound' requested here N* n = this ->lowerBound(min); // current node. ^ IpMap.cc:1260:21: note: in instantiation of member function 'ts::detail::IpMapBase<ts::detail::Ip6Node>::mark' requested here this ->force6()->mark(ink_inet_ip6_cast(min), ink_inet_ip6_cast(max), data); ^ IpMap.cc:1164:13: note: ' operator <' should be declared prior to the call site or in the global namespace inline bool operator <(sockaddr_in6 const * lhs, sockaddr_in6 const & rhs) { ^ 4 errors generated. I'll commit the other changes (after I test them on Linux), but I'll need assistant from some C++ propeller head with the template madness above .
        Hide
        Leif Hedstrom added a comment -

        This fixes the build problems with clang. Alan, is this the right solution?

        Show
        Leif Hedstrom added a comment - This fixes the build problems with clang. Alan, is this the right solution?
        Leif Hedstrom made changes -
        Field Original Value New Value
        Attachment TS-1116.diff [ 12515194 ]
        Show
        Igor Galić added a comment - http://git-wip-us.apache.org/repos/asf?p=trafficserver.git;a=commit;h=23af5c5b56d8d3c4d61ace903908f98ec3b7d12a http://git-wip-us.apache.org/repos/asf?p=trafficserver.git;a=commit;h=fe1da80b94d368343174ada8b137a0c4ae1c387e http://git-wip-us.apache.org/repos/asf?p=trafficserver.git;a=commit;h=56c29c0a1dd950eba82039f3f4dcb950a1fdff6b
        Igor Galić made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Leif Hedstrom [ zwoop ] Igor Galić [ i.galic ]
        Resolution Fixed [ 1 ]
        Igor Galić made changes -
        Backport to Version 3.0.5 [ 12320055 ]
        Affects Version/s 3.0.3 [ 12318544 ]
        Affects Version/s 3.0.4 [ 12320054 ]
        Hide
        Igor Galić added a comment -

        assigning to brian, since he's taking care of 3.0.x now

        Show
        Igor Galić added a comment - assigning to brian, since he's taking care of 3.0.x now
        Igor Galić made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Assignee Igor Galić [ i.galic ] Brian Geffon [ briang ]
        Hide
        Jan-Frode Myklebust added a comment -

        Brian, please see patch in TS-1185. I've cherry picked commit 9e3459a1006ad2e4381d20fe5374a11994dccf88 and cea3c71360a066a24b39e36ee116e83ea1db1bc8 into v3.0.4 to make it build on fedora-17 which has gcc-4.7. It would be great if you could include these patches in the upcoming v3.0.5 release.

        Show
        Jan-Frode Myklebust added a comment - Brian, please see patch in TS-1185 . I've cherry picked commit 9e3459a1006ad2e4381d20fe5374a11994dccf88 and cea3c71360a066a24b39e36ee116e83ea1db1bc8 into v3.0.4 to make it build on fedora-17 which has gcc-4.7. It would be great if you could include these patches in the upcoming v3.0.5 release.
        Hide
        Brian Geffon added a comment - - edited

        Ok, i'll make the final vote for it and it will be included in 3.0.5.

        Show
        Brian Geffon added a comment - - edited Ok, i'll make the final vote for it and it will be included in 3.0.5.
        Hide
        Brian Geffon added a comment -

        @Jan-Frode Myklebust: all that will be included in 3.0.5 will be the commits referenced in the STATUS file which is only fe1da80b94d368343174ada8b137a0c4ae1c387e.

        @Igor, should there be multiple SHAs in the STATUS file, should I be backporting based on your comment above / and or start a new vote?

        Show
        Brian Geffon added a comment - @Jan-Frode Myklebust: all that will be included in 3.0.5 will be the commits referenced in the STATUS file which is only fe1da80b94d368343174ada8b137a0c4ae1c387e. @Igor, should there be multiple SHAs in the STATUS file, should I be backporting based on your comment above / and or start a new vote?
        Hide
        Igor Galić added a comment -

        Brian,

        I only added the SHAs which seemed sensible. The one for configure.in to add -Werror didn't seem useful for this particular bug.

        Show
        Igor Galić added a comment - Brian, I only added the SHAs which seemed sensible. The one for configure.in to add -Werror didn't seem useful for this particular bug.
        Hide
        Brian Geffon added a comment -

        Backported to 3.0.x in commit 944d5babae425706e6238904ee2df621a68ef010

        Show
        Brian Geffon added a comment - Backported to 3.0.x in commit 944d5babae425706e6238904ee2df621a68ef010
        Brian Geffon made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Fix Version/s 3.0.5 [ 12320055 ]
        Resolution Fixed [ 1 ]
        Leif Hedstrom made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Brian Geffon
            Reporter:
            Leif Hedstrom
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development