Fix warnings from added -W flags

Fix a few warnings:

 idc.c: In function ‘IDC_get’:
 idc.c:248:12: warning: ‘idclen’ may be used uninitialised in this function [-Wuninitialized]

 image.c: In function ‘image_load’:
 image.c:37:15: warning: unused variable ‘bytes_read’ [-Wunused-variable]

Plus, a bunch of strict-aliasing warnings:

 image.c:101:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 [ similar warnings trimmed ]

when compiling image.c. Since struct external_PEI_DOS_hdr uses char[]
types for all members, we need to use accessors here.

Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
This commit is contained in:
Jeremy Kerr 2012-06-11 16:33:18 +08:00
parent 34edfd6348
commit ffc1f41ace
3 changed files with 40 additions and 10 deletions

View file

@ -1,6 +1,6 @@
#!/bin/bash
ccan_modules="talloc read_write_all"
ccan_modules="talloc read_write_all build_assert"
# Add ccan upstream sources
if [ ! -e lib/ccan.git/Makefile ]