Boost logo

Boost :

From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2000-09-29 17:02:15


I think <boost/stdint.h> is a fundamental design flaw and should
be removed and/or folded into <boost/cstdint.hpp>.

Here is why:

The names int8_t etc. in the global scope are reserved by the
C99 standard. Accordingly, various platform headers originating
from the C programming environment are allowed to define these
names, possibly even without (visibly) including <stdint.h>.

For example, the GNU C library 2.1.2 defines int8_t in its
<sys/types.h> header. (A secret #define prevents clashes for the
case when its (slightly problematic) <stdint.h> is included as
well.) When <boost/stdint.h> is included, it tries to define
int8_t again and fails whenever a previous #include has
indirectly included <sys/types.h> by chance.

We could work around this particular issue with additional
#ifdef ... logic, but this only scratches the surface.

In general, boost should confine itself to names in the boost
namespace except for well isolated portability issues (see
boost/operators.hpp). In particular, boost should not try to
provide missing Standard C functionality in the global scope,
because this may fail with some implementations.

Thus, I herewith propose to replace the using-declarations
within <boost/cstdint.hpp> with the typedef's of <boost/stdint.h>
for the !BOOST_SYSTEM_HAS_STDINT_H case.

Jens Maurer


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