Opened 14 years ago

Closed 14 years ago

#2000 closed Bugs (fixed)

boost/detail/spinlock_sync.hpp incorrectly included for Intel C++ on Linux

Reported by: Anthony Williams Owned by: Peter Dimov
Milestone: Boost 1.37.0 Component: smart_ptr
Version: Boost 1.35.0 Severity: Regression
Keywords: Cc:

Description

On a linux-x86_64 system with gcc 4.1.3 and Intel 10.1, an include of boost/shared_ptr.hpp pulls in boost/detail/spinlock_sync.hpp, which fails to compile since the sync functions are undefined.

It appears this problem is due to the #if sequence in boost/detail/spinlock.hpp. The Intel compiler defines GNUC and GNUC_MINOR, but doesn't provide the intrinsics.

By adding "&& !defined(BOOST_INTEL)" to the appropriate #if line as in the attached patch, everything works.

Attachments (1)

spinlock.patch (609 bytes ) - added by Anthony Williams 14 years ago.
Patch for boost/detail/spinlock.hpp

Download all attachments as: .zip

Change History (6)

by Anthony Williams, 14 years ago

Attachment: spinlock.patch added

Patch for boost/detail/spinlock.hpp

comment:1 by Peter Dimov, 14 years ago

Status: newassigned

The same problem is pointed out in this thread:

http://lists.boost.org/Archives/boost/2008/06/138322.php

but it seems that some installations of Intel C++ do handle the code fine:

http://lists.boost.org/Archives/boost/2008/06/138337.php

The problem might be caused by the system headers:

http://lists.boost.org/Archives/boost/2008/06/138341.php

It's not clear to me at the moment what the right fix is.

comment:2 by Anthony Williams, 14 years ago

It appears to me to depend on the version of gcc used as the system compiler: certainly, if GNUC < 4, the problematic header won't be included. That's why I suggested the change I did. Of course, I'm not sure why Intel is defining GNUC anyway, but I guess it's for compatibility, like the Windows compiler defines _MSC_VER.

comment:3 by Peter Dimov, 14 years ago

Milestone: Boost 1.36.0Boost 1.37.0

comment:4 by notquitezeus@…, 14 years ago

I've observed the same problem on SuSE 10.3 x86_32 with ICC 10.1.15 (GCC primitives sync* not defined). I will give the patch a try once I get into the office tomorrow morning.

comment:5 by Peter Dimov, 14 years ago

Resolution: fixed
Status: assignedclosed

(In [48836]) Fix #2000.

Note: See TracTickets for help on using tickets.