Skip to content

Commit

Permalink
Add -Werror=format-overflow compile flag
Browse files Browse the repository at this point in the history
Some build environment will automatically add -Werror=format-overflow
compile flag.

Signed-off-by: Min Xu <min.m.xu@intel.com>
  • Loading branch information
mxu9 committed Apr 3, 2024
1 parent 42c17d5 commit 5a67b34
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions teeio-validator/include/ide_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#define MAX_SUPPORTED_PORTS_NUM 16
#define MAX_SUPPORTED_SWITCHES_NUM 16
#define MAX_SUPPORTED_SWITCH_PORTS_NUM 16
#define PORT_NAME_LENGTH 16
#define SWITCH_NAME_LENGTH 16
#define PORT_NAME_LENGTH 32
#define SWITCH_NAME_LENGTH 32
#define BDF_LENGTH 8
#define DF_LENGTH 5
#define TEST_CASE_DESCRIPTION_LENGTH 32
Expand Down
2 changes: 1 addition & 1 deletion teeio-validator/teeio_validator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 2.8.12)

ADD_COMPILE_OPTIONS(-Wno-unused-result -Werror)
ADD_COMPILE_OPTIONS(-Wno-unused-result -Werror=format-overflow -Werror)

if(CMAKE_BUILD_TYPE STREQUAL "Release")
ADD_COMPILE_OPTIONS(-Wno-error=unused-variable -Wno-error=unused-but-set-variable)
Expand Down
4 changes: 2 additions & 2 deletions teeio-validator/teeio_validator/scan_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ bool scan_rp_switch_internal_port_at_bus(IDE_PORT* port, uint8_t bus, uint8_t* S
int fd = -1;

port->bus = bus;
sprintf(port->bdf, "%02x:%02x.%x", bus, port->device, port->function);
snprintf(port->bdf, BDF_LENGTH, "%02x:%02x.%x", bus, port->device, port->function&0xf);

TEEIO_DEBUG((TEEIO_DEBUG_INFO, "Scan %s...\n", port->bdf));

Expand Down Expand Up @@ -114,7 +114,7 @@ bool scan_endpoint_at_bus(uint8_t bus, IDE_PORT* port)
int fd = -1;

port->bus = bus;
sprintf(port->bdf, "%02x:%02x.%x", bus, port->device, port->function);
snprintf(port->bdf, BDF_LENGTH, "%02x:%02x.%x", bus, port->device, port->function&0xf);

TEEIO_DEBUG((TEEIO_DEBUG_INFO, "Scan endpoint(%s)...\n", port->bdf));

Expand Down

0 comments on commit 5a67b34

Please sign in to comment.