Skip to content

Commit 3b449cd

Browse files
committed
Enable -Werror in developer build
1 parent 1e8a44a commit 3b449cd

File tree

6 files changed

+18
-8
lines changed

6 files changed

+18
-8
lines changed

cmake/helpers.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,9 @@ function(add_umf_target_compile_options name)
244244
target_compile_definitions(${name} PRIVATE -D_FORTIFY_SOURCE=2)
245245
endif()
246246
if(UMF_DEVELOPER_MODE)
247-
target_compile_options(${name} PRIVATE -fno-omit-frame-pointer
248-
-fstack-protector-strong)
247+
target_compile_options(
248+
${name} PRIVATE -fno-omit-frame-pointer
249+
-fstack-protector-strong -Werror)
249250
endif()
250251
if(UMF_USE_COVERAGE)
251252
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")

src/provider/provider_devdax_memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ static umf_result_t devdax_open_ipc_handle(void *provider,
474474
LOG_DEBUG("devdax mapped (path: %s, size: %zu, protection: %i, fd: %i, "
475475
"offset: %zu) to address %p",
476476
devdax_ipc_data->path, length_aligned,
477-
devdax_ipc_data->protection, fd, offset_aligned, addr);
477+
devdax_ipc_data->protection, fd, offset_aligned, (void *)addr);
478478

479479
*ptr = addr;
480480

src/provider/provider_file_memory.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,8 @@ static umf_result_t file_open_ipc_handle(void *provider, void *providerIpcData,
697697
LOG_DEBUG("file mapped (path: %s, size: %zu, protection: %i, fd: %i, "
698698
"offset: %zu) at address %p",
699699
file_ipc_data->path, file_ipc_data->size,
700-
file_ipc_data->protection, fd, file_ipc_data->offset_fd, addr);
700+
file_ipc_data->protection, fd, file_ipc_data->offset_fd,
701+
(void *)addr);
701702

702703
*ptr = addr;
703704

test/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,11 @@ function(build_umf_test)
7575
# tests retrieve arguments using 'GetParam()', which applies a 'const'
7676
# qualifier often discarded in the test scenarios.
7777
target_compile_options(${TEST_TARGET_NAME} PRIVATE -Wno-cast-qual)
78-
endif()
7978

79+
if(UMF_DEVELOPER_MODE)
80+
target_compile_options(${TEST_TARGET_NAME} PRIVATE -Werror)
81+
endif()
82+
endif()
8083
target_link_directories(${TEST_TARGET_NAME} PRIVATE ${LIB_DIRS})
8184

8285
target_include_directories(

test/ipc_os_prov_proxy.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ int main(int argc, char *argv[]) {
106106
}
107107

108108
fprintf(stderr, "Allocated memory - %zu\n", size);
109-
size_t val = 144;
110-
size_t expected_val = val / 2;
111-
*(size_t *)ptr = val;
109+
unsigned long long val = 144;
110+
unsigned long long expected_val = val / 2;
111+
*(unsigned long long *)ptr = val;
112112

113113
// get IPC handle of the allocation
114114
umf_ipc_handle_t ipc_handle = NULL;

test/poolFixtures.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ struct umfPoolTest : umf_test::test,
7070

7171
auto [pool_ops, pool_params, provider_ops, provider_params,
7272
coarse_params] = this->GetParam();
73+
(void)pool_ops;
74+
(void)pool_params;
75+
(void)provider_params;
76+
(void)coarse_params;
77+
7378
if (provider_ops == umfDevDaxMemoryProviderOps()) {
7479
char *path = getenv("UMF_TESTS_DEVDAX_PATH");
7580
if (path == nullptr || path[0] == 0) {

0 commit comments

Comments
 (0)