Yes, unless until we clearly understand that volatile is not useful here, we
should keep it.
Regards,
Basant.
On Fri, Dec 12, 2008 at 02:57:03PM -0800, Chris Darroch wrote:
> Ruediger Pluem wrote:
>
>> Not quite sure if this is really correct because apr_atomic_casptr
>> wants to have a (volatile void**) as first parameter.
>
> That's what made me less than sure ... but my gcc 4.1.2 -Wall
> definitely doesn't like that void** ("dereferencing type-punned pointer ...").
>
> I think void* should be OK, because the APR function still
> gets a pointer-sized parameter, and casts it to (volatile void**)
> locally, which is presumably what really matters: that within the CAS
> function the optimizer understands that the pointed-to value (another
> pointer, in this case) can be changed by something else it doesn't
> know about, and so won't optimize away any accesses.
>
> But ... I'm no expert on these kinds of compiler guts. Revert if
> it seems wrong and better to spew some warnings.
>
> Chris.
>
> --
> GPG Key ID: 366A375B
> GPG Key Fingerprint: 485E 5041 17E1 E2BB C263 E4DE C8E3 FA36 366A 375B
>