Re: [PATCH] perf tools: Kill off -Wcast-align

From: David Miller
Date: Mon Oct 26 2009 - 18:40:41 EST


From: Paul Mundt <lethal@xxxxxxxxxxxx>
Date: Mon, 26 Oct 2009 18:47:30 +0900

> On Mon, Oct 26, 2009 at 07:25:20AM +0100, Ingo Molnar wrote:
>>
>> * Paul Mundt <lethal@xxxxxxxxxxxx> wrote:
>>
>> > The present use of -Wcast-align causes the build to blow up on SH due to
>> > generating a "cast increases required alignment of target type" error on
>> > each invocation of list_for_each_entry().
>> >
>> > It seems that this was previously reported and killed off in the ia64
>> > support patch, but nothing seems to have happened with that. Presumably
>> > the same problem still remains there, too.
>> >
>> > Signed-off-by: Paul Mundt <lethal@xxxxxxxxxxxx>
>>
>> Is this a GCC bug producing false positive warnings? The GCC manpage
>> says:
>>
>> -Wcast-align
>> Warn whenever a pointer is cast such that the required alignment of the
>> target is increased. For example, warn if a "char *" is cast to an
>> "int *" on machines where integers can only be accessed at two- or
>> four-byte boundaries.
>>
>> Which looks moderately useful - if it works.
>>
> Well, both ia64 and sh have hit this in the current compilers, and it
> doesn't seem to pose any code generation issues. In the areas where it is
> generated it seems to relate to 64-bit data types in the data structures,
> which in itself doesn't seem inherently problematic.

sparc64 hits this too when building 32-bit perf binary, the first
thing I do after a pull is remove this warning option from the
Makefile :-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/