From bd63a2b690b7f28b920f2f647850d9389882d8b5 Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Fri, 4 Dec 2020 22:18:14 -0600 Subject: [PATCH] Cleanup warnings when using clang. Change-Id: I09f72831e29bccdb4170c54e203872412e2f0b59 --- rocrtst/samples/CMakeLists.txt | 4 +++- rocrtst/samples/rocrinfo/rocrinfo.cc | 20 ++++++++++---------- rocrtst/suites/negative/queue_validation.cc | 2 +- rocrtst/suites/test_common/CMakeLists.txt | 3 ++- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/rocrtst/samples/CMakeLists.txt b/rocrtst/samples/CMakeLists.txt index dad10c327b..aed6556c33 100755 --- a/rocrtst/samples/CMakeLists.txt +++ b/rocrtst/samples/CMakeLists.txt @@ -187,8 +187,10 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-math-errno") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-threadsafe-statics") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmerge-all-constants") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fms-extensions") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-braces") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64") # diff --git a/rocrtst/samples/rocrinfo/rocrinfo.cc b/rocrtst/samples/rocrinfo/rocrinfo.cc index 0738cf2ba9..321c6769ee 100755 --- a/rocrtst/samples/rocrinfo/rocrinfo.cc +++ b/rocrtst/samples/rocrinfo/rocrinfo.cc @@ -58,17 +58,17 @@ // This structure holds system information acquired through hsa info related // calls, and is later used for reference when displaying the information. -typedef struct { +struct system_info_t { uint16_t major, minor; uint64_t timestamp_frequency = 0; uint64_t max_wait = 0; hsa_endianness_t endianness; hsa_machine_model_t machine_model; -} system_info_t; +}; // This structure holds agent information acquired through hsa info related // calls, and is later used for reference when displaying the information. -typedef struct { +struct agent_info_t { char name[64]; char vendor_name[64]; hsa_agent_feature_t agent_feature; @@ -95,12 +95,12 @@ typedef struct { uint16_t workgroup_max_dim[3]; uint16_t bdf_id; bool fast_f16; -} agent_info_t; +}; // This structure holds memory pool information acquired through hsa info // related calls, and is later used for reference when displaying the // information. -typedef struct { +struct pool_info_t { uint32_t segment; size_t pool_size; bool alloc_allowed; @@ -108,12 +108,12 @@ typedef struct { size_t pool_alloc_alignment; bool pl_access; uint32_t global_flag; -} pool_info_t; +}; // This structure holds ISA information acquired through hsa info // related calls, and is later used for reference when displaying the // information. -typedef struct { +struct isa_info_t { char *name_str; uint32_t workgroup_max_size; hsa_dim3_t grid_max_dim; @@ -125,16 +125,16 @@ typedef struct { bool mach_models[2]; bool profiles[2]; bool fast_f16; -} isa_info_t; +}; // This structure holds cache information acquired through hsa info // related calls, and is later used for reference when displaying the // information. -typedef struct { +struct cache_info_t { char *name_str; uint8_t level; uint32_t size; -} cache_info_t; +}; static const uint32_t kLabelFieldSize = 25; static const uint32_t kValueFieldSize = 35; diff --git a/rocrtst/suites/negative/queue_validation.cc b/rocrtst/suites/negative/queue_validation.cc index 528194d638..7c5a93e053 100755 --- a/rocrtst/suites/negative/queue_validation.cc +++ b/rocrtst/suites/negative/queue_validation.cc @@ -466,7 +466,7 @@ void QueueValidation::QueueValidationForInvalidPacket(hsa_agent_t cpuAgent, rocrtst::WriteAQLToQueueLoc(queue[ii], index, &aql()); // setting the invalid packet type aql().header = HSA_PACKET_TYPE_KERNEL_DISPATCH; - aql().header |= -1 << HSA_PACKET_HEADER_TYPE; + aql().header |= 0xFFFFFFFF << HSA_PACKET_HEADER_TYPE; aql().kernel_object = kernel_object(); void* q_base = queue[ii]->base_address; diff --git a/rocrtst/suites/test_common/CMakeLists.txt b/rocrtst/suites/test_common/CMakeLists.txt index e1bcb03c1e..e8ebf35537 100755 --- a/rocrtst/suites/test_common/CMakeLists.txt +++ b/rocrtst/suites/test_common/CMakeLists.txt @@ -190,14 +190,15 @@ add_definitions(-DLITTLEENDIAN_CPU=1) # set(CMAKE_CXX_FLAGS "-std=c++11 ") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-math-errno") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-threadsafe-statics") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmerge-all-constants") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fms-extensions") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused") # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") #