Boost logo

Boost :

From: Jonathan Wakely (cow_at_[hidden])
Date: 2004-08-17 06:56:21


On Tue, Aug 17, 2004 at 06:25:30AM -0500, Aaron W. LaFramboise wrote:

> Daryle Walker wrote:
> > I don't understand what problem this change is going to solve. If a
> > compiler has a strict C++-1998 mode, then supporting "(unsigned) long long"
> > anyway is sort-of a disfeature. Maybe we should just have the headers
> > assume that the double-long types are absent. (The changes don't affect
> > compilers that don't have the double-long types at all, right?)
>
> The -std=c++98 option (also called -ansi) causes gcc to become standards
> compliant. Without it, gcc implements a nonstandard "GNU" dialect of
> C++. People who desire standards conformance and better compile-time
> checking often use this option. For many C++ projects, all files are
> compiled with it along with the more familiar -Wall.
>
> As a side effect, it causes errors to be generated when the long long
> typename is used unadorned.

This isn't strictly true. "long long" will be accepted without any
diagnostic, even with "-ansi -Wall", it is "-pedantic" that causes it to
be rejected. I tested this on Linux and FreeBSD, with 2.95 and 3.[0345],
and the doc links you gave confirm it:

    The -ansi option does not cause non-ISO programs to be rejected
    gratuitously. For that, -pedantic is required in addition to -ansi.
    See Warning Options.

> (I've heard this might be changed in the
> future, as long long might not actually conflict with the standard.)
> All of the support is still there, including from the standard library.
> You can still use long long provided you add __extension__, as
> documented in the manual.
>
> To further clarify, -std=c++98 does not disable long long, and in
> general, does not disable extensions. It just means you need to use a
> special syntax when you use the long long type name.

To further clarify, it's -pedantic that means you need __extension__,
with or without -std=c++98 / -ansi

> So, to answer your question, this patch makes Boost compile for people
> who use the very common practice of compiling with -std=c++98 (or
> -pedantic).

This should read "... practice of compiling with -pedantic."

jon

-- 
"Any sufficiently advanced bug is indistinguishable from a feature"
	- Rich Kulawiec

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