Skip to content

Commit cee499f

Browse files
fyin1jren1
authored andcommitted
DM: fix build issue with gcc 4.8.4 on ubuntu 14.04
There are two build issues: - add -fno-strict-aliasing to address error: dereferencing type-punned pointer will break strict-aliasing rules - initialize tfd to zero to address error: ‘tfd’ may be used uninitialized in this function Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
1 parent 0a0ff19 commit cee499f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

devicemodel/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ CFLAGS += -m64
1616
CFLAGS += -Wall -ffunction-sections
1717
CFLAGS += -Werror
1818
CFLAGS += -O2 -D_FORTIFY_SOURCE=2
19-
CFLAGS += -Wformat -Wformat-security
19+
CFLAGS += -Wformat -Wformat-security -fno-strict-aliasing
2020

2121
CFLAGS += -I$(BASEDIR)/include
2222
CFLAGS += -I$(BASEDIR)/include/public

devicemodel/hw/pci/ahci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ static void
14781478
atapi_mode_sense(struct ahci_port *p, int slot, uint8_t *cfis)
14791479
{
14801480
uint8_t *acmd;
1481-
uint32_t tfd;
1481+
uint32_t tfd = 0;
14821482
uint8_t pc, code;
14831483
int len;
14841484

0 commit comments

Comments
 (0)