Boost logo

Boost-Build :

From: Joel de Guzman (joel_at_[hidden])
Date: 2005-08-05 19:12:58


Joel de Guzman wrote:
> Rene Rivera wrote:
>
>>Jonathan Turkanis wrote:
>>
>>
>>>On Windows, --a mean strict warnings, and --A means strict errors. Would it be
>>>consistent with the purpose of BOOST_COMO_STRICT (whatever that is) to define it
>>>for strict errors, also?
>>
>>
>>Yes. But since we don't add the "--A" option it a moot point ;-)
>
>
> Why? I have some odd cases where Comeau compiles with --a but not
> without it. Shouldn't we be strict by default?

No reply? I really think that we should compile with --a or --A,
here's why (I emailed Comeau regarding this): The code below
produces the *Wrong* code without the --a:

Using Comeau C/C++ 4.3.3 (Jan 13 2004 11:29:09) for MS_WINDOWS_x86
Using MSVC 7.1 backend, Given this code:

#include <iostream>

template <typename T> int foo(T&) { return 1; }
template <typename T> int foo(T const&) { return 2; }

struct X {};

int
main()
{
std::cout << foo(X()) << std::endl;
return 0;
}

When I compile using:
como --vc71 -o

I get:
warning: initial value of reference to
non-const must be an lvalue
std::cout << foo(X()) << std::endl;

and prints out 1

When I compile using:
como --a --vc71 -o

The compile succeeds and prints out 2

Here's Comeau's reply:

Note that w/o any other options, you'll be running in microsoft
compatibility mode. At the point 4.3.3 was released there was some
leapfrogging around 7.x compatibility changes that have since been made.

................

The very least I could ask is a way to invoke Comeau with strict
settings. Is there a way to do that?

Regards,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net
 

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk