]> xenbits.xensource.com Git - osstest/seabios.git/commitdiff
memmap: Fix gcc out-of-bounds warning
authorKevin O'Connor <kevin@koconnor.net>
Sat, 18 Dec 2021 17:08:53 +0000 (12:08 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 18 Dec 2021 17:08:53 +0000 (12:08 -0500)
Use a different definition for the linker script symbol to avoid a gcc
warning.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/memmap.h

index 22bd4bcb855cd787917bc7679af97842f731df95..32ca265315992018ad11978270f72241e324b539 100644 (file)
@@ -15,7 +15,7 @@ static inline void *memremap(u32 addr, u32 len) {
 }
 
 // Return the value of a linker script symbol (see scripts/layoutrom.py)
-#define SYMBOL(SYM) ({ extern char SYM; (u32)&SYM; })
+#define SYMBOL(SYM) ({ extern char SYM[]; (u32)SYM; })
 #define VSYMBOL(SYM) ((void*)SYMBOL(SYM))
 
 #endif // memmap.h