Boost logo

Boost :

Subject: Re: [boost] [gil::io_new] Help with gcc compiler
From: Christian Henning (chhenning_at_[hidden])
Date: 2012-07-04 16:33:08


Hi Nathan,

> On Mon, Jul 2, 2012 at 8:32 PM, Christian Henning <chhenning_at_[hidden]> wrote:
>> Hi there,
>>
>> I'm in the process of making my gil extension ready for inclusion. The
>> code is now stable and I'm trying to get gcc/clang to work. Since I'm
>> no expert with gcc I would like to ask for some help with various
>> compiler errors.
>
> it looks like the two major areas are problems with VS allowing you to
> bind temporaries to mutable references, and missing typenames. You're
> probably familiar with both, but I'll explain the former problem as
> well as attach a diff that allows your program to compile. The
> problem is similar to the following:
> int make_int(); //returns rvalue
> void foo(int&); //standard says this should take a mutable lvalue
> ...
> foo(make_int());//Forbidden by standard, allowed by default with VS.
>
> Options are to have foo take its parameter by value or const&, or to
> declare a temporary before the invocation of foo, and pass the
> temporary to that. The diff I'm attaching just passes the reader and
> writer by value, though I'm not at all sure that's the right thing
> here. . .

OK, I understand. This is very helpful. Thanks!

>
>
>> The complete test suite compiles with Visual Studio 2010 without any warnings.
>
> We compile with VC10 and gcc 4.5 at my work. We've found the boost
> guidelines to be very helpful in catching cross-platform problems
> early:
> https://svn.boost.org/trac/boost/wiki/Guidelines/WarningsGuidelines
> (see the 'Defining Warnings as Errors' section, particularly 4239 and
> 4346, which may have helped in this case).

OK, I'll change my warning level to 4 and fix everything I can. Seems
like boost::gil generates quite a few warnings, as well. But that's
for later.

Thanks again!

Christian


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