Subject: Re: gcc4 compile fixes

From: Christian <[email-masked]>
Date: Mon, 04 Apr 2005 15:57:24 +0200

replying to myself:

Christian wrote:
> now it [1] fails with:
> 
> In file included from arch/ppc/kernel/time.c:68:
> include/asm/time.h:61: warning: type qualifiers ignored on function return
> type
[...]

..and there were other error messages too. not knowing a *bit* of C, i was
able to do minor alterations which i deduced from gcc's error messages.
now compiling for ppc604 (PReP) with gcc4 succeeds.

thank you for your concern,
Christian.
- --
BOFH excuse #403:

Sysadmin didn't hear pager go off due to loud music from bar-room speakers.
--- linux-2.6/arch/ppc/syslib/open_pic_defs.h.orig	2005-04-04 15:01:39.581824538 +0200
+++ linux-2.6/arch/ppc/syslib/open_pic_defs.h	2005-04-04 15:01:52.679696972 +0200
@@ -172,7 +172,7 @@
     OpenPIC_Processor Processor[OPENPIC_MAX_PROCESSORS];
 };
 
-extern volatile struct OpenPIC __iomem *OpenPIC;
+static volatile struct OpenPIC __iomem *OpenPIC;

     /*
--- linux-2.6/arch/ppc/kernel/time.c.orig	2005-04-04 15:12:41.963801575 +0200
+++ linux-2.6/arch/ppc/kernel/time.c	2005-04-04 15:12:56.390559608 +0200
@@ -89,7 +89,7 @@
 
 extern unsigned long wall_jiffies;
 
-static long time_offset;
+extern long time_offset;
 
 DEFINE_SPINLOCK(rtc_lock);
 
--- linux-2.6/include/asm-ppc/time.h.orig	2005-04-04 14:47:55.526765569 +0200
+++ linux-2.6/include/asm-ppc/time.h	2005-04-04 14:49:59.075129571 +0200
@@ -58,7 +58,7 @@
 /* Accessor functions for the timebase (RTC on 601) registers. */
 /* If one day CONFIG_POWER is added just define __USE_RTC as 1 */
 #ifdef CONFIG_6xx
-extern __inline__ int const __USE_RTC(void) {
+static __inline__ int const __USE_RTC(void) {
 	return (mfspr(SPRN_PVR)>>16) == 1;
 }
 #else
@@ -92,7 +92,7 @@
 	mtspr(SPRN_TBWL, lower);
 }
 
-extern __inline__ unsigned long get_rtcl(void) {
+static __inline__ unsigned long get_rtcl(void) {
 	unsigned long rtcl;
 	asm volatile("mfrtcl %0" : "=r" (rtcl));
 	return rtcl;
--- linux-2.6/include/asm-ppc/prom.h.orig	2005-04-04 14:56:50.014752710 +0200
+++ linux-2.6/include/asm-ppc/prom.h	2005-04-04 14:59:59.805414063 +0200
@@ -13,8 +13,8 @@
 typedef void *phandle;
 typedef void *ihandle;
 
-extern char *prom_display_paths[];
-extern unsigned int prom_num_displays;
+static char *prom_display_paths[];
+static unsigned int prom_num_displays;
 
 struct address_range {
 	unsigned int space;