From ef0adffad5a95183ddd69c30aca80bc19876f876 Mon Sep 17 00:00:00 2001 From: Tilen Majerle Date: Wed, 27 Jul 2022 11:56:23 +0200 Subject: [PATCH] Reduce compiler warnings for -Wall -Wpedantic -Wextra --- CMakeLists.txt | 13 ++++++++++--- dev/main.c | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 74cd60a..ea23ef2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,12 +19,12 @@ add_executable(${PROJECT_NAME}) # Add key executable block target_sources(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR}/dev/main.c - ) +) # Add key include paths target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR}/dev - ) +) # Compilation definition information target_compile_definitions(${PROJECT_NAME} PUBLIC @@ -32,7 +32,14 @@ target_compile_definitions(${PROJECT_NAME} PUBLIC _DEBUG CONSOLE LWSHELL_DEV - ) +) + +# Compiler options +target_compile_options(${PROJECT_NAME} PRIVATE + -Wall + -Wextra + -Wpedantic +) # Add subdir with lwshell and link to project add_subdirectory("lwshell" lwshell) diff --git a/dev/main.c b/dev/main.c index e6a570f..30e6ff2 100644 --- a/dev/main.c +++ b/dev/main.c @@ -78,6 +78,7 @@ subdbl_cmd(int32_t argc, char** argv) { */ void shell_output(const char* str, lwshell_t* lw) { + (void)lw; printf("%s", str); if (*str == '\r') { printf("\n");