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>
This commit is contained in:
Yin Fengwei 2018-04-12 11:36:28 +08:00 committed by Jack Ren
parent 0a0ff19eaa
commit cee499f867
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ CFLAGS += -m64
CFLAGS += -Wall -ffunction-sections CFLAGS += -Wall -ffunction-sections
CFLAGS += -Werror CFLAGS += -Werror
CFLAGS += -O2 -D_FORTIFY_SOURCE=2 CFLAGS += -O2 -D_FORTIFY_SOURCE=2
CFLAGS += -Wformat -Wformat-security CFLAGS += -Wformat -Wformat-security -fno-strict-aliasing
CFLAGS += -I$(BASEDIR)/include CFLAGS += -I$(BASEDIR)/include
CFLAGS += -I$(BASEDIR)/include/public CFLAGS += -I$(BASEDIR)/include/public

View File

@ -1478,7 +1478,7 @@ static void
atapi_mode_sense(struct ahci_port *p, int slot, uint8_t *cfis) atapi_mode_sense(struct ahci_port *p, int slot, uint8_t *cfis)
{ {
uint8_t *acmd; uint8_t *acmd;
uint32_t tfd; uint32_t tfd = 0;
uint8_t pc, code; uint8_t pc, code;
int len; int len;