Re: [PATCH] Fix gcc 4 warnings on ia64

Andi Kleen
2005-08-16T23:34:39Z

On Wed, Aug 17, 2005 at 09:04:24AM +1000, Peter Chubb wrote:
> >>>>> "Andi" = Andi Kleen <ak@suse.de> writes:
>
> Andi> I was compiling an IA64 2.6.13rc6 kernel on a machine with gcc 4
> Andi> to test something. The compile spew a incredibly large number of
> Andi> warnings. This patch fixes the most annoying ones from commonly
> Andi> included makefiles. In these two cases gcc was complaining that
> Andi> functions cannot be volatile or const.
>
> You actually need the const attribute on __ia64_get_io_port_base ---
> see the thread at
> http://www.gelato.unsw.edu.au/archives/linux-ia64/0507/14658.html

Ian is wrong here. const never did the same thing as __attribute__((const))

And for an inline __attribute__((const)) is a nop because the compiler
always looks at the code inside the inline and decides based
on that if the return value is constant or not.

-Andi