Fix aliasing violations

Andreas Schwab schwab@suse.de
Sat Oct 23 19:08:00 GMT 2004


Daniel Jacobowitz <drow@false.org> writes:

> On Sat, Oct 23, 2004 at 08:26:28PM +0200, Andreas Schwab wrote:
>> The macro GROW_VECT in ada-lang.h violates the C aliasing rules.
>> 
>> Andreas.
>> 
>> 2004-10-23  Andreas Schwab  <schwab@suse.de>
>> 
>> 	* ada-lang.c (grow_vect): Return the new array instead of
>> 	expecting pointer to pointer to avoid violation of aliasing rules.
>> 	* ada-lang.h (GROW_VECT): Adapt call to grow_vect.
>
> I assume newer versions of GCC warn about this?

Yes, that's -Wstrict-aliasing, part of -Wall.

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



More information about the Gdb-patches mailing list