Opened 12 years ago

Last modified 10 years ago

#4186 new Bugs

BOOST date_time:"time_resolution_traits" undeclared or ambig error on IBM XL on AIX

Reported by: ccambly@… Owned by: az_sw_dude
Milestone: Boost 1.54.0 Component: date_time
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

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.

Attachments (1)

time_resolution_traits.hpp.diff (1.1 KB ) - added by ccambly@… 12 years ago.

Download all attachments as: .zip

Change History (2)

by ccambly@…, 12 years ago

comment:1 by rockdreamer@…, 10 years ago

Milestone: Boost 1.43.0Boost 1.54.0
Version: Boost 1.42.0Boost 1.54.0

Can this patch be merged for the next release? I've been applying it from 1.4something to 1.53.0 in order to compile on AIX.

I'm changing the milestone and version in order to make the ticket more visible. I'm sorry if this is bad etiquette. If it is, please point me to documentation on how to properly "bump" issues and I'll gladly comply.

Thanks :)

Note: See TracTickets for help on using tickets.