Reduce compiler warnings for -Wall -Wpedantic -Wextra

This commit is contained in:
Tilen Majerle 2022-07-27 11:56:23 +02:00
parent 0485e5dd90
commit ef0adffad5
2 changed files with 11 additions and 3 deletions

View File

@ -19,12 +19,12 @@ add_executable(${PROJECT_NAME})
# Add key executable block # Add key executable block
target_sources(${PROJECT_NAME} PUBLIC target_sources(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/dev/main.c ${CMAKE_CURRENT_LIST_DIR}/dev/main.c
) )
# Add key include paths # Add key include paths
target_include_directories(${PROJECT_NAME} PUBLIC target_include_directories(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/dev ${CMAKE_CURRENT_LIST_DIR}/dev
) )
# Compilation definition information # Compilation definition information
target_compile_definitions(${PROJECT_NAME} PUBLIC target_compile_definitions(${PROJECT_NAME} PUBLIC
@ -32,7 +32,14 @@ target_compile_definitions(${PROJECT_NAME} PUBLIC
_DEBUG _DEBUG
CONSOLE CONSOLE
LWSHELL_DEV LWSHELL_DEV
) )
# Compiler options
target_compile_options(${PROJECT_NAME} PRIVATE
-Wall
-Wextra
-Wpedantic
)
# Add subdir with lwshell and link to project # Add subdir with lwshell and link to project
add_subdirectory("lwshell" lwshell) add_subdirectory("lwshell" lwshell)

View File

@ -78,6 +78,7 @@ subdbl_cmd(int32_t argc, char** argv) {
*/ */
void void
shell_output(const char* str, lwshell_t* lw) { shell_output(const char* str, lwshell_t* lw) {
(void)lw;
printf("%s", str); printf("%s", str);
if (*str == '\r') { if (*str == '\r') {
printf("\n"); printf("\n");