__atomic_futex_unsigned::_M_load_when_not_equal has a 'return' statement with no value, in function returning unsigned int
Jonathan Wakely
jwakely@redhat.com
Fri Jul 24 16:30:00 GMT 2015
On 23/07/15 23:54 +0200, Torvald Riegel wrote:
>On Thu, 2015-07-23 at 09:21 +0100, Jonathan Wakely wrote:
>> On 22/07/15 22:30 -0400, Patrick Palka wrote:
>> >Specifically, line 149 of atomix_futex.h has a bare "return;"
>> >statement, but the function is marked as returning non-void. This was
>> >caught while working on PR c++/18969. Vanilla G++ does not catch this
>> >error because return statements inside templates are currently only
>> >analyzed during instantiation time.
>>
>> Ouch. Luckily that function is never called, so it's not doing any
>> harm.
>>
>> Torvald, assuming we want to keep that unused function, is this the
>> right fix?
>
>I think so. Thanks!
I'm committing this which also makes some other small tweaks.
Tested powerpc64le-linux, committed to trunk. Will commit to
gcc-5-branch too.
Torvald, I wonder if instead of doing (unsigned*)(void*)&_M_data, to
get to the member of the atomic<unsigned> we should make
__atomic_futex_unsigned a friend of __atomic_base so it can do that
more cleanly. I was OK with the casts earlier, but am changing my
mind.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 2276 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20150724/874691a3/attachment.bin>
More information about the Libstdc++
mailing list