Enable GCC warning flag -Wnested-externs, fix warnings

Move nested extern declarations into header files, or use the
already existing declarations.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@861 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Blue Swirl
2010-09-06 20:56:54 +00:00
parent 7ec1ce2826
commit e00c8ab982
10 changed files with 16 additions and 11 deletions

View File

@@ -12,7 +12,7 @@ HOSTCC := gcc
HOSTCFLAGS+= -O2 -g -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) HOSTCFLAGS+= -O2 -g -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS)
HOSTCFLAGS+= -Wall -Wredundant-decls -Wshadow -Wpointer-arith HOSTCFLAGS+= -Wall -Wredundant-decls -Wshadow -Wpointer-arith
HOSTCFLAGS+= -Wstrict-prototypes -Wmissing-declarations -Wundef -Wendif-labels HOSTCFLAGS+= -Wstrict-prototypes -Wmissing-declarations -Wundef -Wendif-labels
HOSTCFLAGS+= -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes HOSTCFLAGS+= -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes -Wnested-externs
HOSTCFLAGS+= -W HOSTCFLAGS+= -W
HOSTINCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include HOSTINCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
@@ -27,7 +27,7 @@ RANLIB := $(TARGET)ranlib
CFLAGS+= -Os -g -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS CFLAGS+= -Os -g -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS
CFLAGS+= -Wall -Wredundant-decls -Wshadow -Wpointer-arith CFLAGS+= -Wall -Wredundant-decls -Wshadow -Wpointer-arith
CFLAGS+= -Wstrict-prototypes -Wmissing-declarations -Wundef -Wendif-labels CFLAGS+= -Wstrict-prototypes -Wmissing-declarations -Wundef -Wendif-labels
CFLAGS+= -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes CFLAGS+= -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes -Wnested-externs
CFLAGS+= -Werror CFLAGS+= -Werror
INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
AS_FLAGS+= -g AS_FLAGS+= -g

View File

@@ -50,7 +50,6 @@ struct cpudef {
static uint16_t machine_id = 0; static uint16_t machine_id = 0;
extern void unexpected_excep( int vector ); extern void unexpected_excep( int vector );
extern void setup_timers( void );
void void
unexpected_excep( int vector ) unexpected_excep( int vector )

View File

@@ -8,6 +8,7 @@
#include "context.h" #include "context.h"
#include "libopenbios/sys_info.h" #include "libopenbios/sys_info.h"
#include "boot.h" #include "boot.h"
#include "openbios.h"
#define MAIN_STACK_SIZE 16384 #define MAIN_STACK_SIZE 16384
#define IMAGE_STACK_SIZE 4096 #define IMAGE_STACK_SIZE 4096
@@ -46,7 +47,6 @@ unsigned long __boot_ctx;
static void start_main(void) static void start_main(void)
{ {
int retval; int retval;
extern int openbios(void);
/* Save startup context, so we can refer to it later. /* Save startup context, so we can refer to it later.
* We have to keep it in physical address since we will relocate. */ * We have to keep it in physical address since we will relocate. */

View File

@@ -8,6 +8,7 @@
#include "context.h" #include "context.h"
#include "libopenbios/sys_info.h" #include "libopenbios/sys_info.h"
#include "boot.h" #include "boot.h"
#include "openbios.h"
#define MAIN_STACK_SIZE 16384 #define MAIN_STACK_SIZE 16384
#define IMAGE_STACK_SIZE 4096*2 #define IMAGE_STACK_SIZE 4096*2
@@ -46,7 +47,6 @@ unsigned long __boot_ctx;
static void start_main(void) static void start_main(void)
{ {
int retval; int retval;
extern int openbios(void);
/* Save startup context, so we can refer to it later. /* Save startup context, so we can refer to it later.
* We have to keep it in physical address since we will relocate. */ * We have to keep it in physical address since we will relocate. */

View File

@@ -12,6 +12,7 @@
#include "context.h" #include "context.h"
#include "libopenbios/sys_info.h" #include "libopenbios/sys_info.h"
#include "boot.h" #include "boot.h"
#include "openbios.h"
#define MAIN_STACK_SIZE 16384 #define MAIN_STACK_SIZE 16384
#define IMAGE_STACK_SIZE 4096 #define IMAGE_STACK_SIZE 4096
@@ -57,8 +58,6 @@ unsigned long __boot_ctx;
static void start_main(void) static void start_main(void)
{ {
int retval; int retval;
extern int openbios(void);
extern void init_exceptions(void);
/* Save startup context, so we can refer to it later. /* Save startup context, so we can refer to it later.
* We have to keep it in physical address since we will relocate. */ * We have to keep it in physical address since we will relocate. */

View File

@@ -50,8 +50,6 @@ static void init_memory(void)
static void static void
arch_init( void ) arch_init( void )
{ {
void setup_timers(void);
openbios_init(); openbios_init();
modules_init(); modules_init();
#ifdef CONFIG_DRIVER_PCI #ifdef CONFIG_DRIVER_PCI

View File

@@ -19,6 +19,9 @@
int openbios(void); int openbios(void);
/* entry.S */
void init_exceptions(void);
/* console.c */ /* console.c */
extern void cls(void); extern void cls(void);
#ifdef CONFIG_DEBUG_CONSOLE #ifdef CONFIG_DEBUG_CONSOLE

View File

@@ -10,6 +10,7 @@
*/ */
#include "config.h" #include "config.h"
#include "drivers/drivers.h"
#include "timer.h" #include "timer.h"
#include "asm/io.h" #include "asm/io.h"
@@ -86,7 +87,6 @@ unsigned long get_timer_freq(void)
void udelay(unsigned int usecs) void udelay(unsigned int usecs)
{ {
extern void _wait_ticks(unsigned long);
unsigned long ticksperusec = get_timer_freq() / 1000000; unsigned long ticksperusec = get_timer_freq() / 1000000;
_wait_ticks(ticksperusec * usecs); _wait_ticks(ticksperusec * usecs);
} }

View File

@@ -48,13 +48,15 @@
#define PPCB_SPKR 0x02 /* Bit 1 */ #define PPCB_SPKR 0x02 /* Bit 1 */
#define PPCB_T2GATE 0x01 /* Bit 0 */ #define PPCB_T2GATE 0x01 /* Bit 0 */
extern void setup_timers(void);
extern void ndelay(unsigned int nsecs); extern void ndelay(unsigned int nsecs);
extern void udelay(unsigned int usecs); extern void udelay(unsigned int usecs);
extern void mdelay(unsigned int msecs); extern void mdelay(unsigned int msecs);
extern unsigned long currticks(void); extern unsigned long currticks(void);
extern unsigned long get_timer_freq(void); extern unsigned long get_timer_freq(void);
/* arch/ppc/timebase.S */
void _wait_ticks(unsigned long nticks);
#define TICKS_PER_SEC 1000 #define TICKS_PER_SEC 1000
#endif /* TIMER_H */ #endif /* TIMER_H */

View File

@@ -123,4 +123,8 @@ int keyboard_dataready(void);
unsigned char keyboard_readdata(void); unsigned char keyboard_readdata(void);
#endif #endif
#endif #endif
/* drivers/timer.c */
void setup_timers(void);
#endif /* OPENBIOS_DRIVERS_H */ #endif /* OPENBIOS_DRIVERS_H */