#7979 closed Bugs (fixed)
atomic library compilation error on 1.53.0
Reported by: | Owned by: | timblechmann | |
---|---|---|---|
Milestone: | To Be Determined | Component: | atomic |
Version: | Boost 1.53.0 | Severity: | Problem |
Keywords: | atomic compilation error | Cc: |
Description
Hello,
I can't compile boost::atomic in boost 1.53.0 version with buildroot trunk version, uClibc 0.9.33 and gcc 4.6.3.
I think the problem comes from uClibc : "error: 'uintptr_t' was not declared in this scope". See attached compilation log for more information!
Attachments (1)
Change History (12)
by , 10 years ago
Attachment: | boost_compilation_log added |
---|
comment:1 by , 10 years ago
Version: | Boost 1.52.0 → Boost 1.53.0 |
---|
related to #7823, we basically just work around that bug manually.
victor, i don't have a uclibc toolchain on my system, but can you try to change
defined(_XOPEN_UNIX) && (_XOPEN_UNIX+0 > 0)
to
defined(_XOPEN_UNIX) && (_XOPEN_UNIX+0 > 0) && !defined(__UCLIBC__)
comment:2 by , 10 years ago
Thanks, this works fine (compilation finished successfully)!
Will you commit it?
comment:3 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 10 years ago
Thanks, but I don't agree so much with your commit, at least with your comment : indeed, uClibc have stdint.h file, which declare intptr_t and uintptr_t (see http://git.uclibc.org/uClibc/tree/include/stdint.h at line 118).
So, maybe, there is a better way to solve this issue.
comment:5 by , 10 years ago
the correct way to solve it is to use <boost/cstdint.hpp> and boost::intptr_t ... however apparently that is broken and undermaintained, so we just work around this. unfortunately uclibc doesn't seem to be covered by the automatic tests, so i'd prefer to exclude functionality to be on the safe side
comment:7 by , 9 years ago
I having this problem with "boost/atomic/atomic.hpp:166:16: error: ‘uintptr_t’ was not declared in this scope". boost-1.53.0, glibc 2.18, gcc 4.9_20131013.
./boost/atomic/atomic.hpp:166:16: error: ‘uintptr_t’ was not declared in this scope ./boost/atomic/atomic.hpp:166:25: error: template argument 1 is invalid ./boost/atomic/atomic.hpp:166:43: error: invalid type in declaration before ‘’ token
comment:8 by , 9 years ago
I confirm david.heidelberger's problem. I can reproduce it on today's Arch Linux release (2013-10-27), g++ 4.8.2, Boost 1.54.0, glibc instead of ulibc.
The problem is still related to the _XOPEN_UNIX definition. It causes atomic.h to typedef "atomic<uintptr_t> atomic_uintptr_t". However, uintptr_t is not defined. This is because boost/cstdint.hpp does not include stdint.h due to this line:
#if defined(BOOST_HAS_STDINT_H) && (!defined(GLIBC) defined(GLIBC_HAVE_LONG_LONG))
I don't know what's the proper way to fix this problem. Defining GLIBC_HAVE_LONG_LONG works along the problem though.
By the way, there is a duplicate here: https://svn.boost.org/trac/boost/ticket/8973
comment:9 by , 9 years ago
Modifying boost/atomic/atomic.hpp as follows also solves the compilation problem:
- || (defined(_XOPEN_UNIX) && (_XOPEN_UNIX+0 > 0) && !defined(__UCLIBC__)) \ + || (defined(_XOPEN_UNIX) && (_XOPEN_UNIX+0 > 0) && !defined(__UCLIBC__) && !defined(__GLIBC__)) \
atomic compilation log