|
Boost : |
From: Jonathan Wakely (cow_at_[hidden])
Date: 2004-07-26 04:07:41
On Mon, Jul 26, 2004 at 09:55:37AM +0100, Jonathan Wakely wrote:
> On Sun, Jul 25, 2004 at 11:29:35PM -0500, Aaron W. LaFramboise wrote:
>
> > These three lines near the end of boost/type_traits/is_convertable.hpp:
> >
> > TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_CV_SPEC(float)
> > TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_CV_SPEC(double)
> > TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_CV_SPEC(long double)
> >
> > don't compile on GCC 3.4.1 when -pedantic is specified.
> > So, there is probably at
> > least a GCC bug here. Does anyone have any idea what this is about?
> > $ g++ -pedantic -I../boost -c stuff.cpp
> > In file included from stuff.cpp:1:
> > ../boost/boost/type_traits/is_convertible.hpp:274: error: long, short,
> > signed or unsigned used invalidly for `type name'
> > ../boost/boost/type_traits/is_convertible.hpp:274: error: long, short,
> > signed or unsigned used invalidly for `type name'
> > ../boost/boost/type_traits/is_convertible.hpp:274: error: redefinition
> > of `struct boost::is_convertible<float, int64_t>'
>
> I think it's due to the use of "long long", which isn't allowed in
> -pedantic mode. Or something like that. Maybe it's long double.
FWIW, changing line 263 of is_convertible.hpp to use "int64_t" rather
than "long long" causes the same (unhelpful) diagnostic on unix.
So it seems that in -pedantic mode mingw uses int64_t instead of "long
long", which breaks as soon as you say "[un]signed long long", because
int64_t is by definition sugned (uint64_t is the unsigned equivalent).
> The redefinition errors are presumably because it isn't distinguishing
> between "signed long long" and "unsigned long long" as template params.
Or rather, it (correctly) can't distinguish between int64_t and int64_t.
jon
-- No sig today
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk