On Sat, May 23, 2015 at 03:47:32PM +0200, Paul Menzel wrote:
Dear SeaBIOS folks,
building SeaBIOS commit 67643955 (make SeaBios compatible with Xen vTPM.) for coreboot with the attached configuration with GCC 5.1.1, (CPP 4.9) the following warnings are printed.
$ gcc-5 --version gcc-5 (Debian 5.1.1-7) 5.1.1 20150522 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ CC=gcc-5 make Build Kconfig config file Compile checking out/src/misc.o In file included from src/misc.c:13:0: src/string.h:18:13: warning: inline function 'memcpy_far' declared but never defined inline void memcpy_far(u16 d_seg, void *d_far ^
Thanks. It looks like gcc v5 is picky about using the "inline" keyword in function declarations. Patch below fixes the warnings for me.
-Kevin
commit a8a8fc9e35af6d1ee660a5f3a6f4a825f4465824 Author: Kevin O'Connor kevin@koconnor.net Date: Mon Jun 1 18:32:06 2015 -0400
Don't forward declare functions with "inline" in headers
Don't mark function definitions in headers with "inline" - it causes compile warnings on gcc v5.
Signed-off-by: Kevin O'Connor kevin@koconnor.net
diff --git a/src/hw/usb-hid.h b/src/hw/usb-hid.h index ef34e79..fd7b8f8 100644 --- a/src/hw/usb-hid.h +++ b/src/hw/usb-hid.h @@ -4,10 +4,10 @@ // usb-hid.c struct usbdevice_s; int usb_hid_setup(struct usbdevice_s *usbdev); -inline int usb_kbd_active(void); -inline int usb_kbd_command(int command, u8 *param); -inline int usb_mouse_active(void); -inline int usb_mouse_command(int command, u8 *param); +int usb_kbd_active(void); +int usb_kbd_command(int command, u8 *param); +int usb_mouse_active(void); +int usb_mouse_command(int command, u8 *param); void usb_check_event(void);
diff --git a/src/string.h b/src/string.h index a557d6a..d069989 100644 --- a/src/string.h +++ b/src/string.h @@ -11,12 +11,12 @@ size_t strlen(const char *s); int memcmp_far(u16 s1seg, const void *s1, u16 s2seg, const void *s2, size_t n); int memcmp(const void *s1, const void *s2, size_t n); int strcmp(const char *s1, const char *s2); -inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t len); -inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t len); +void memset_far(u16 d_seg, void *d_far, u8 c, size_t len); +void memset16_far(u16 d_seg, void *d_far, u16 c, size_t len); void *memset(void *s, int c, size_t n); void memset_fl(void *ptr, u8 val, size_t size); -inline void memcpy_far(u16 d_seg, void *d_far - , u16 s_seg, const void *s_far, size_t len); +void memcpy_far(u16 d_seg, void *d_far + , u16 s_seg, const void *s_far, size_t len); void memcpy_fl(void *d_fl, const void *s_fl, size_t len); void *memcpy(void *d1, const void *s1, size_t len); #if MODESEGMENT == 0