Boost logo

Boost :

Subject: [boost] Workaround for clang-linux + GNU stdlib + Boost.Iostreams
From: Bryce Lelbach (admin_at_[hidden])
Date: 2011-01-01 16:35:48


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

There's a discrepancy in the definition of wint_t between GCC and some later
versions of clang (clang defines it as an int, GCC an unsigned int). This
ends breaking Boost.Iostreams with a GNU GCC compiled version of the GNU stdlib
and clang (I'll restrain myself from giving the lengthy technical explaination -
if you have link-time errors with clang + GCC compiled stdlib + Boost.Iostreams,
this is probably the issue).

Unfortunately, I cannot patch this issue with a workaround in Boost easily. The
right combination of clang flags can work around this by not using the clang
intrinsic/builtin headers, but this has a good chance of causing other problems.

The simplest solution here is to rebuild clang (building the GNU stdlib with clang
is tricky at best). I think newer version of the mainstream clang trunk may have
fixed this, but if not, you need to change the assignment to WIntType in the
clang::TargetInfo ctor ($CLANG_ROOT/lib/Basic/TargetInfo.cpp, line 40-50ish).
It should be UnsignedInt.

You also need to hack $CLANG_ROOT/lib/Headers/stdint.h, around 630 - the macro
definition of WINT_MIN and WINT_MAX need to be changed to:

#define WINT_MIN 0u
#define WINT_MAX __UINTN_MAX(__WINT_WIDTH__)

If you'd rather not recompile clang, you can try hacking your clang intrinsic
headers (not advisable, might break more stuff). Find the resource/intrinsic
header directory (usually something like /usr/local/clang/2.9/include/), and make
the change specified above to the stdint.h header there. In the stddef.h header,
around like 60, you can change the wint_t typedef.

- --
Bryce Lelbach aka wash
boost-spirit.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAk0fnjQACgkQO/fqqIuE2t7NVQCgowl7TqnCRgWyjRGN+/u3fh2R
NywAoK59zWsZiB7vVvtKU0IehHiMIVdz
=COrS
-----END PGP SIGNATURE-----


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk