* [PATCH] Fix gcc 4 warnings on ia64
@ 2005-08-16 15:57 Andi Kleen
2005-08-16 23:04 ` Peter Chubb
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Andi Kleen @ 2005-08-16 15:57 UTC (permalink / raw)
To: linux-ia64
I was compiling an IA64 2.6.13rc6 kernel on a machine with gcc 4
to test something. The compile spew a incredibly large number
of warnings. This patch fixes the most annoying ones from
commonly included makefiles. In these two cases gcc was complaining
that functions cannot be volatile or const.
There are a lot more warnings left, but they're in individual files.
Most seem to be uninitialized variables because gcc 4 can track
individual structure members for that now.
Signed-off-by: Andi Kleen <ak@suse.de>
diff -u linux-2.6.13rc6/include/asm-ia64/mmu.h-o linux-2.6.13rc6/include/asm-ia64/mmu.h
diff -u linux-2.6.13rc6/include/asm-ia64/io.h-o linux-2.6.13rc6/include/asm-ia64/io.h
--- linux-2.6.13rc6/include/asm-ia64/io.h-o 2005-06-17 21:48:29.000000000 +0200
+++ linux-2.6.13rc6/include/asm-ia64/io.h 2005-08-16 17:37:56.539836121 +0200
@@ -120,7 +120,7 @@
ia64_mfa();
}
-static inline const unsigned long
+static inline unsigned long
__ia64_get_io_port_base (void)
{
extern unsigned long ia64_iobase;
diff -u linux-2.6.13rc6/include/asm-ia64/mmu_context.h-o linux-2.6.13rc6/include/asm-ia64/mmu_context.h
--- linux-2.6.13rc6/include/asm-ia64/mmu_context.h-o 2005-08-16 17:33:16.000000000 +0200
+++ linux-2.6.13rc6/include/asm-ia64/mmu_context.h 2005-08-16 17:45:14.310318038 +0200
@@ -62,7 +62,7 @@
}
}
-static inline mm_context_t
+static inline unsigned long
get_mmu_context (struct mm_struct *mm)
{
unsigned long flags;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix gcc 4 warnings on ia64
2005-08-16 15:57 [PATCH] Fix gcc 4 warnings on ia64 Andi Kleen
@ 2005-08-16 23:04 ` Peter Chubb
2005-08-16 23:34 ` Andi Kleen
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Peter Chubb @ 2005-08-16 23:04 UTC (permalink / raw)
To: linux-ia64
>>>>> "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
--
Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au
The technical we do immediately, the political takes *forever*
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix gcc 4 warnings on ia64
2005-08-16 15:57 [PATCH] Fix gcc 4 warnings on ia64 Andi Kleen
2005-08-16 23:04 ` Peter Chubb
@ 2005-08-16 23:34 ` Andi Kleen
2005-08-17 0:05 ` Luck, Tony
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Andi Kleen @ 2005-08-16 23:34 UTC (permalink / raw)
To: linux-ia64
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] Fix gcc 4 warnings on ia64
2005-08-16 15:57 [PATCH] Fix gcc 4 warnings on ia64 Andi Kleen
2005-08-16 23:04 ` Peter Chubb
2005-08-16 23:34 ` Andi Kleen
@ 2005-08-17 0:05 ` Luck, Tony
2005-08-17 0:11 ` Andi Kleen
2005-08-17 1:30 ` david mosberger
4 siblings, 0 replies; 6+ messages in thread
From: Luck, Tony @ 2005-08-17 0:05 UTC (permalink / raw)
To: linux-ia64
> You actually need the const attribute on __ia64_get_io_port_base
cscope didn't show any users of this function ... so I thought
perhaps the callers were in some macros that concatenated
strings with ## to make the name, but I couldn't see any.
So I tried the big hammer and just deleted the function
entirely to see what would complain, but nothing did (for
compile with defconfig and tiger_defconfig).
So unless something very, very, very subtle is happening
here, I'd say the fix would be to delete this function
altogether. Rumours of better/worse code with/without
the "const" modifier look to be unfounded.
Hint: we also store ia64_iobase in ar.k0 ... so perhaps this
function has been obsolete for a while?
-Tony
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix gcc 4 warnings on ia64
2005-08-16 15:57 [PATCH] Fix gcc 4 warnings on ia64 Andi Kleen
` (2 preceding siblings ...)
2005-08-17 0:05 ` Luck, Tony
@ 2005-08-17 0:11 ` Andi Kleen
2005-08-17 1:30 ` david mosberger
4 siblings, 0 replies; 6+ messages in thread
From: Andi Kleen @ 2005-08-17 0:11 UTC (permalink / raw)
To: linux-ia64
On Tue, Aug 16, 2005 at 05:05:42PM -0700, Luck, Tony wrote:
>
> > You actually need the const attribute on __ia64_get_io_port_base
>
> cscope didn't show any users of this function ... so I thought
> perhaps the callers were in some macros that concatenated
> strings with ## to make the name, but I couldn't see any.
You also need to fix the other function which had a bogus volatile.
BTW I bet the rationale in mmu.h for the volatile is bogus.
-Andi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix gcc 4 warnings on ia64
2005-08-16 15:57 [PATCH] Fix gcc 4 warnings on ia64 Andi Kleen
` (3 preceding siblings ...)
2005-08-17 0:11 ` Andi Kleen
@ 2005-08-17 1:30 ` david mosberger
4 siblings, 0 replies; 6+ messages in thread
From: david mosberger @ 2005-08-17 1:30 UTC (permalink / raw)
To: linux-ia64
On 8/16/05, Andi Kleen <ak@suse.de> wrote:
> 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.
Not if the function contains an "asm", which is what used to be there.
It later got changed to reading a global, so I agree that the
__attribute_const__ is no longer necessary.
--david
--
Mosberger Consulting LLC, voice/fax: 510-744-9372,
http://www.mosberger-consulting.com/
35706 Runckel Lane, Fremont, CA 94536
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-08-17 1:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-16 15:57 [PATCH] Fix gcc 4 warnings on ia64 Andi Kleen
2005-08-16 23:04 ` Peter Chubb
2005-08-16 23:34 ` Andi Kleen
2005-08-17 0:05 ` Luck, Tony
2005-08-17 0:11 ` Andi Kleen
2005-08-17 1:30 ` david mosberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox