Boost logo

Boost Users :

Subject: Re: [Boost-users] 1.45: thread/condition_variable.hpp: unused variable 'res' warning, gcc 4.2
From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2011-01-06 16:34:03


On Thu, Jan 6, 2011 at 9:28 PM, Anthony Williams <anthony.ajw_at_[hidden]> wrote:
> "Hicham Mouline" <hicham_at_[hidden]> writes:
>
>> in Release build in Xcode, gcc 4.2.1,
>>
>> inline void condition_variable::wait(unique_lock<mutex>& m)
>> {
>> ...
>>  int const res = pthread_cond_wait(&cond, &internal_mutex);
>>  BOOST_ASSERT(!res);
>>  ...
>> }
>>
>> Unused variable 'res'
>>
>> is gcc mistaken?
>
> Yes and no :-)
>
> In the release build the assert compiles to nothing, so res is no longer
> referenced, even though it is referenced in the source.
>

I actually have a patch for this:
https://svn.boost.org/trac/boost/ticket/4818 which I don't think has
been merged into (or acted upon) yet.

HTH

-- 
Dean Michael Berris
about.me/deanberris

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net