[zeromq-dev] Casting bug in atomic_counter.hpp - probably only on non x86 or ARM CPUs.

Steven McCoy steven.mccoy at miru.hk
Tue Jun 2 14:07:31 CEST 2015


On 2 June 2015 at 07:51, Dr. David Kirkby (Kirkby Microwave Ltd) <
drkirkby at kirkbymicrowave.co.uk> wrote:

> atomic_counter.hpp:87:71: error: invalid conversion from 'volatile
> integer_t* {aka volatile unsigned int*}' to 'uint32_t* {aka unsigned
> int*}' [-fpermissive]
>
> This is line 87 which the error refers to.
>
> integer_t new_value = atomic_add_32_nv (&value, increment_);
>

This is correct for Oracle Studio,
https://docs.oracle.com/cd/E19253-01/816-5180/6mbbf01oj/index.html

This looks like a defective GCC, I don't think Oracle GCC 3 has these
problems.

You can try using the GCC intrinsics in preference for this particular
compiler version.

-- 
Steve-o
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150602/1daa3f96/attachment.htm>


More information about the zeromq-dev mailing list