This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Patches to fix compiler warnings on IA64
- From: Andreas Schwab <schwab at suse dot de>
- To: Ulrich Drepper <drepper at redhat dot com>
- Cc: Thorsten Kukuk <kukuk at suse dot de>, libc-alpha at sources dot redhat dot com
- Date: Sat, 10 Jul 2004 21:25:59 +0200
- Subject: Re: Patches to fix compiler warnings on IA64
- References: <20040708205339.GA31603@suse.de> <40EDB6EE.4040703@redhat.com>
Ulrich Drepper <drepper@redhat.com> writes:
> Thorsten Kukuk wrote:
>
>> * sysdeps/ia64/bits/atomic.h: Cast first argument of
>> __sync_bool_compare_and_swap_si correct to void*.
>
> Why? The prototypes for the functions a question are
>
> extern void __sync_lock_release_si (int *);
> extern void __sync_lock_release_di (long *);
The problem is that you get aliasing warnings if the argument of the
macros is of different type (even if it has the same size). Especially
for atomic_exchange_and_add there is no other way to avoid the warning.
Here is a better change log entry:
* sysdeps/ia64/bits/atomic.h: Cast first argument of
__sync_bool_compare_and_swap_si and
__sync_bool_compare_and_swap_di to void* to avoid aliasing
warnings.
A similar patch has been applied to <ia64intrin.h>.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."