Skip to content

Commit

Permalink
memmap: Fix gcc out-of-bounds warning
Browse files Browse the repository at this point in the history
Use a different definition for the linker script symbol to avoid a gcc
warning.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
  • Loading branch information
KevinOConnor committed Dec 18, 2021
1 parent 0a1e767 commit 98dd53b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/memmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 98dd53b

Please sign in to comment.