mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 15:41:40 +00:00
e94136bd87
It seems that gcc 6.3 at least is smart enough to warn about the _val variable being unassigned in the default case in the set_hdr_field() macro, but not smart enough to figure out that the default case is never taken. This results in warnings such as the following: pfx##hdr32[idx].field = _val; \ ^ ../tools/mips-relocs.c:51:11: note: _val was declared here uint64_t _val; \ ^ ../tools/mips-relocs.c:88:2: note: in expansion of macro set_hdr_field set_hdr_field(p, idx, field, val) ^~~~~~~~~~~~~ ../tools/mips-relocs.c:408:3: note: in expansion of macro set_phdr_field set_phdr_field(i, p_filesz, load_sz); ^~~~~~~~~~~~~~ ../tools/mips-relocs.c: In function main: ../tools/mips-relocs.c:77:25: warning: _val may be used uninitialized in this function [-Wmaybe-uninitialized] Avoid this by assigning _val = 0 in the default case, and asserting that we didn't actually hit it for good measure. For reference gcc 7.1.1 seems to be smart enough to not hit the above warning without this patch. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Fixes: 011dd93ca97a ("MIPS: Stop building position independent code") Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Tom Rini <trini@konsulko.com> Cc: u-boot@lists.denx.de |
||
---|---|---|
.. | ||
binman | ||
buildman | ||
dtoc | ||
easylogo | ||
env | ||
gdb | ||
kermit | ||
logos | ||
omap | ||
patman | ||
scripts | ||
.gitignore | ||
aisimage.c | ||
aisimage.h | ||
atmel_pmecc_params.c | ||
atmelimage.c | ||
bmp_logo.c | ||
default_image.c | ||
dumpimage.c | ||
dumpimage.h | ||
envcrc.c | ||
fdt_host.h | ||
fdtgrep.c | ||
fit_check_sign.c | ||
fit_common.c | ||
fit_common.h | ||
fit_image.c | ||
fit_info.c | ||
gen_eth_addr.c | ||
gen_ethaddr_crc.c | ||
genboardscfg.py | ||
getline.c | ||
getline.h | ||
gpheader.h | ||
gpimage-common.c | ||
gpimage.c | ||
ifdtool.c | ||
ifdtool.h | ||
image-host.c | ||
imagetool.c | ||
imagetool.h | ||
img2brec.sh | ||
img2srec.c | ||
imximage.c | ||
imximage.h | ||
jtagconsole | ||
kwbimage.c | ||
kwbimage.h | ||
kwboot.c | ||
lpc32xximage.c | ||
Makefile | ||
microcode-tool | ||
microcode-tool.py | ||
mingw_support.c | ||
mingw_support.h | ||
mips-relocs.c | ||
mkenvimage.c | ||
mkexynosspl.c | ||
mkimage.c | ||
mkimage.h | ||
mksunxiboot.c | ||
moveconfig.py | ||
mxsboot.c | ||
mxsimage.c | ||
mxsimage.h | ||
ncb.c | ||
netconsole | ||
omapimage.c | ||
omapimage.h | ||
os_support.c | ||
os_support.h | ||
pbl_crc32.c | ||
pbl_crc32.h | ||
pblimage.c | ||
pblimage.h | ||
proftool.c | ||
relocate-rela.c | ||
rkcommon.c | ||
rkcommon.h | ||
rkimage.c | ||
rkmux.py | ||
rksd.c | ||
rkspi.c | ||
socfpgaimage.c | ||
sunxi-spl-image-builder.c | ||
ublimage.c | ||
ublimage.h | ||
ubsha1.c | ||
vybridimage.c | ||
xway-swap-bytes.c | ||
zynqimage.c | ||
zynqmpimage.c |