Boost logo

Boost :

From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2001-06-24 17:01:12


John Max Skaller wrote:
> > You're running the compiler with "-ansi -pedantic", thus you
> > explicitly asked to ban any non-standard construct, such as
> > "long long" (which is not standard C++). Try removing the
> > "-ansi -pedantic".
>
> The only effect of these switches is to produce a warning
> for long long, which is suppressed by -Wno-long-long.
> Without the -D_GNU_SOURCE, long long constants compile fine.
> I tried without the -ansi -pedantic, it has no effect.
> I do want these switches: I want 'strictly conforming'
> C99/C++ code (with long long, including literals).

I'm using gcc 2.95.3 on Linux to compile this program:

#include <boost/cstdint.hpp>

int main()
{
  boost::int32_t x;
  boost::int64_t y;
}

Here are the results:
no flags: int64_t undefined
-D_GNU_SOURCE: works
-ansi -D_GNU_SOURCE: works
-pedantic: int64_t undefined
-pedantic -D_GNU_SOURCE: "too many 'l's in integer constant"
-pedantic -Wno-long-long -D_GNU_SOURCE: "too many ..."

Can you reproduce these results? Could you try your original
problem again without -pedantic?

The info page for -pedantic (info from gcc 3.0) says:
`-pedantic'
     Issue all the warnings demanded by strict ISO C and ISO C++;
     reject all programs that use forbidden extensions, and some other
     programs that do not follow ISO C and ISO C++.

"Reject" appears to allude to the real error message as opposed
to a warning. "-Wno-long-long" appears to fiddle with warnings
only.

Jens Maurer


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