[syslinux] syslinux-4.03-pre4 + MCONFIG.devel + gcc 4.5

Sebastian Herbszt herbszt at gmx.de
Mon Oct 11 12:44:29 PDT 2010


H. Peter Anvin wrote:
> On 10/10/2010 12:29 PM, Sebastian Herbszt wrote:
>> I am getting
>>
>> cc1: warnings being treated as errors
>> strspn.c: In function 'strxspn':
>> strspn.c:14:20: error: inlining failed in call to 'set_bit': optimizing for size and code size would grow
>> strspn.c:32:9: error: called from here
>> strspn.c:14:20: error: inlining failed in call to 'set_bit': optimizing for size and code size would grow
>> strspn.c:36:9: error: called from here
>>
>> with gcc version 4.5.0 20100604 [gcc-4_5-branch revision 160292] (SUSE Linux)
>>
>
> Yeah, not to mention the fact that that code is generic code which can
> be done *much* better on x86...
>
> On the other hand, for 4.03 we should probably just drop the "inline".
>
> -hpa

After applying the appended patch i am stuck with

gcc -Wp,-MT,disk/bootloaders.o,-MD,disk/.bootloaders.o.d -Os -march=i386 -falign-functions=0 -falign-jumps=0 -falign-labels=0 
 -ffast-math -fomit-frame-pointer -std=gnu99 -m32 -fno-stack-protector -fwrapv -freg-struct-return -fPIE -fno-exceptions 
 -fno-asynchronous-unwind-tables -fno-strict-aliasing -falign-functions=0 -falign-jumps=0 -falign-labels=0 -falign-loops=0 
 -mpreferred-stack-boundary=2 -g -mregparm=3 -DREGPARM=3 -D__COM32__ -nostdinc -iwithprefix 
include -I. -I./sys -I../include -I../gplinclude -W -Wall -Wstrict-prototypes -Wno-clobbered -Werror -Wpointer-arith -Wwrite-strings 
 -Wstrict-prototypes -Winline -DDYNAMIC_CRC_TABLE -DPNG_NO_CONSOLE_IO -DPNG_NO_WRITE_SUPPORTED -DPNG_NO_MNG_FEATURES -DPNG_NO_READ_tIME 
 -DPNG_NO_WRITE_tIME -c -o disk/bootloaders.o disk/bootloaders.c
cc1: warnings being treated as errors
../gplinclude/cpuid.h:176:24: error: 'test_bit' defined but not used
make[2]: *** [disk/bootloaders.o] Error 1

Sebastian

diff --git a/com32/gplinclude/cpuid.h b/com32/gplinclude/cpuid.h
index bc9df17..ed597c8 100644
--- a/com32/gplinclude/cpuid.h
+++ b/com32/gplinclude/cpuid.h
@@ -173,7 +173,7 @@ typedef struct {
 #define X86_VENDOR_NUM 9
 #define X86_VENDOR_UNKNOWN 0xff

-static inline __purefunc bool test_bit(int nr, const uint32_t * addr)
+static __purefunc bool test_bit(int nr, const uint32_t * addr)
 {
     return ((1UL << (nr & 31)) & (addr[nr >> 5])) != 0;
 }
diff --git a/com32/lib/strspn.c b/com32/lib/strspn.c
index abbbf17..db14b0c 100644
--- a/com32/lib/strspn.c
+++ b/com32/lib/strspn.c
@@ -11,7 +11,7 @@
 #define LONG_BIT (CHAR_BIT*sizeof(long))
 #endif

-static inline void set_bit(unsigned long *bitmap, unsigned int bit)
+static void set_bit(unsigned long *bitmap, unsigned int bit)
 {
     bitmap[bit / LONG_BIT] |= 1UL << (bit % LONG_BIT);
 }
diff --git a/com32/lib/vsscanf.c b/com32/lib/vsscanf.c
index 153dbbd..b9fdefc 100644
--- a/com32/lib/vsscanf.c
+++ b/com32/lib/vsscanf.c
@@ -46,7 +46,7 @@ enum bail {
     bail_err                   /* Conversion mismatch */
 };

-static inline const char *skipspace(const char *p)
+static const char *skipspace(const char *p)
 {
     while (isspace((unsigned char)*p))
        p++;
@@ -54,7 +54,7 @@ static inline const char *skipspace(const char *p)
 }

 #undef set_bit
-static inline void set_bit(unsigned long *bitmap, unsigned int bit)
+static void set_bit(unsigned long *bitmap, unsigned int bit)
 {
     bitmap[bit / LONG_BIT] |= 1UL << (bit % LONG_BIT);
 }




More information about the Syslinux mailing list