[Boost-bugs] [Boost C++ Libraries] #4186: BOOST date_time:"time_resolution_traits" undeclared or ambig error on IBM XL on AIX

Subject: [Boost-bugs] [Boost C++ Libraries] #4186: BOOST date_time:"time_resolution_traits" undeclared or ambig error on IBM XL on AIX
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-05-04 17:52:45


#4186: BOOST date_time:"time_resolution_traits" undeclared or ambig error on IBM
XL on AIX
--------------------------------+-------------------------------------------
 Reporter: ccambly@… | Owner: az_sw_dude
     Type: Bugs | Status: new
Milestone: Boost 1.43.0 | Component: date_time
  Version: Boost 1.42.0 | Severity: Problem
 Keywords: |
--------------------------------+-------------------------------------------
 Tests affected:
 interprocess/comp_doc_anonymous_mutexA
 interprocess/comp_doc_anonymous_mutexB
 interprocess/comp_doc_anonymous_semaphoreA
 interprocess/comp_doc_anonymous_semaphoreB
 interprocess/comp_doc_anonymous_upgradable_mutexA
 interprocess/comp_doc_anonymous_upgradable_mutexB
 interprocess/comp_doc_anonymous_conditionA
 interprocess/comp_doc_anonymous_conditionB

 The compile-time error on with IBM XL (vacpp) on AIX is occuring due to
 name collision between a macro name (v_type) found on the OS in
 /usr/include/sys/vnode.h and same named template argument found in the
 boost header boost/date_time/time_resolution_traits.hpp.

 Here is a reduced test that demonstrates the problem:

 t.C
 =========
 // From /usr/include/sys/vnode.h
 enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VBAD, VFIFO, VMPC
 };
 typedef enum vtype vtype_t;
 struct gnode {
         enum vtype gn_type;
 };

 struct vnode {
         struct gnode *v_gnode;
 };

 #define v_type v_gnode->gn_type

 template<typename v_type = int> class time_resolution_traits
 { };

 ==============
 Command: xlC -c t.C
 Result:
 "t.C", line 15.21: 1540-0063 (S) The text "->" is unexpected.

 Note that this problem is specific to AIX due to this macro used in AIX
 header. Linux or other operating systems do not appear to exhibit this
 problem.

 The solution is to provide a Boost patch file that renames template
 argument to another name in order to avoid name collision with the system
 files.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4186>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC