Opened 13 years ago
Closed 8 years ago
#3669 closed Patches (wontfix)
UINTMAX_C not defined by boost/cstdint.hpp
| Reported by: | Owned by: | John Maddock | |
|---|---|---|---|
| Milestone: | Boost 1.42.0 | Component: | config | 
| Version: | Boost Development Trunk | Severity: | Problem | 
| Keywords: | Cc: | 
Description
In file [source:trunk/libs/thread/src/pthread/once.cpp@43799#L16 libs/thread/src/pthread/once.cpp:16] standard macro UINTMAX_C is used, but stdint.h header is not included.
This causes compilation error when building using Comeau with GCC on Linux 32-bit (Ubuntu 9.04):
mloskot@vb-ubuntu904:~/dev/boost/_svn/trunk/libs/thread/build$ colorbb --v2 link=static
...patience...
...found 519 targets...
...updating 2 targets...
como-linux.compile.c++ ../../../bin.v2/libs/thread/build/como-linux/debug/link-static/threading-multi/pthread/once.o
Comeau C/C++ 4.3.10.1 (May  7 2008 12:23:21) for LINUX_INTEL_ELF_Beta
Copyright 1988-2008 Comeau Computing.  All rights reserved.
MODE:non-strict warnings C++ noC++0x_extensions
"../../../libs/thread/src/pthread/once.cpp", line 16: error: identifier
          "UINTMAX_C" is undefined
          BOOST_THREAD_DECL boost::uintmax_t once_global_epoch=UINTMAX_C(~0);
                                                               ^
1 error detected in the compilation of "../../../libs/thread/src/pthread/once.cpp".
    como -tused -c --long_long  -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_POSIX -D_GNU_SOURCE -D_REENTRANT --no_inlining -O0 -g --exceptions -I"../../.."   -o "../../../bin.v2/libs/thread/build/como-linux/debug/link-static/threading-multi/pthread/once.o" "../../../libs/thread/src/pthread/once.cpp" 2>&1
...failed como-linux.compile.c++ ../../../bin.v2/libs/thread/build/como-linux/debug/link-static/threading-multi/pthread/once.o...
...skipped <p../../../bin.v2/libs/thread/build/como-linux/debug/link-static/threading-multi>libboost_thread.a for lack of <p../../../bin.v2/libs/thread/build/como-linux/debug/link-static/threading-multi>pthread/once.o...
...failed updating 1 target...
...skipped 1 target...
By the way, you may notice that I call como compiler with two extra macros defined:
-D_GNU_SOURCE -D_REENTRANT
They are required to enable C99 and POSIX features for como toolset. I added them to build/Jamfile.v2. However, I'm not including this changes in the patch, because I'm still testing it to confirm it's the right solution. I posted detailed explanation to ml as First results using Comeau C/C++ compiler thread.
Attachments (1)
Change History (4)
by , 13 years ago
| Attachment: | boost-thread-stdint_h-header.patch added | 
|---|
comment:1 by , 12 years ago
| Component: | thread → integer | 
|---|---|
| Owner: | changed from to | 
| Summary: | Missing stdint.h header from pthread/once.cpp → UINTMAX_C not defined by boost/cstdint.hpp | 
libs/thread/src/pthread/once.cpp relies on boost/cstdint.hpp providing UINTMAX_C for initializing a variable of type boost::uintmax_t. Apparently this is not provided for Comeau+gcc on Ubuntu.
comment:2 by , 8 years ago
| Component: | integer → config | 
|---|---|
| Owner: | changed from to | 
comment:3 by , 8 years ago
| Resolution: | → wontfix | 
|---|---|
| Status: | new → closed | 
The macro is defined only when BOOST__STDC_CONSTANT_MACROS_DEFINED is set prior to the #include - exactly as documented.


Patch that adds missing stdint.h header