This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patches to fix compiler warnings on IA64


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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]