From d499a07b0f1233f826cb11e1e10adf00e88374d9 Mon Sep 17 00:00:00 2001 From: Enrico Fraccaroli Date: Tue, 13 Dec 2022 16:56:14 -0500 Subject: [PATCH] Remove -Wno-unused-but-set-variable flag. --- libc/CMakeLists.txt | 1 - mentos/CMakeLists.txt | 1 - mentos/src/fs/ext2.c | 1 + mentos/src/hardware/timer.c | 2 ++ mentos/src/io/proc_running.c | 5 ++--- mentos/src/mem/kheap.c | 2 +- programs/CMakeLists.txt | 1 - programs/tests/CMakeLists.txt | 1 - programs/tests/t_sigfpe.c | 1 + programs/tests/t_siginfo.c | 1 + 10 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt index 0db24e2..e8702a4 100644 --- a/libc/CMakeLists.txt +++ b/libc/CMakeLists.txt @@ -50,7 +50,6 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-pragmas") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable") # Set the compiler options. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static") diff --git a/mentos/CMakeLists.txt b/mentos/CMakeLists.txt index ebac0e5..deb839f 100644 --- a/mentos/CMakeLists.txt +++ b/mentos/CMakeLists.txt @@ -67,7 +67,6 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-pragmas") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable") # Set the compiler options. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static") diff --git a/mentos/src/fs/ext2.c b/mentos/src/fs/ext2.c index 97d157c..011e4de 100644 --- a/mentos/src/fs/ext2.c +++ b/mentos/src/fs/ext2.c @@ -620,6 +620,7 @@ static void ext2_dump_inode(ext2_inode_t *inode) pr_debug("Symlink : %s\n", inode->data.symlink); pr_debug("Generation : %u file_acl : %u dir_acl : %u\n", inode->generation, inode->file_acl, inode->dir_acl); + (void)timeinfo; } /// @brief Dumps on debugging output the dirent. diff --git a/mentos/src/hardware/timer.c b/mentos/src/hardware/timer.c index 9c08ed7..3ff66d0 100644 --- a/mentos/src/hardware/timer.c +++ b/mentos/src/hardware/timer.c @@ -327,6 +327,7 @@ static void __rem_timer_tvec_base(tvec_base_t *base, struct timer_list *timer) int index = 0, tv_index = 0; __find_tvec(base, timer, &index, &tv_index); + // TODO: Check why we do not use vec. struct list_head *vec; switch (tv_index) { case 1: @@ -352,6 +353,7 @@ static void __rem_timer_tvec_base(tvec_base_t *base, struct timer_list *timer) #ifdef ENABLE_REAL_TIMER_SYSTEM_DUMP __dump_all_tvec_slots(base); #endif + (void)vec; } /// Move all timers from tv up one level diff --git a/mentos/src/io/proc_running.c b/mentos/src/io/proc_running.c index 4237604..864eddd 100644 --- a/mentos/src/io/proc_running.c +++ b/mentos/src/io/proc_running.c @@ -393,11 +393,10 @@ static inline ssize_t __procr_read(vfs_file_t *file, char *buffer, off_t offset, char support[BUFSIZ]; memset(support, 0, BUFSIZ); // Call the specific function. - int ret = 0; if (strcmp(entry->name, "cmdline") == 0) - ret = __procr_do_cmdline(support, BUFSIZ, task); + __procr_do_cmdline(support, BUFSIZ, task); else if (strcmp(entry->name, "stat") == 0) - ret = __procr_do_stat(support, BUFSIZ, task); + __procr_do_stat(support, BUFSIZ, task); // Copmute the amounts of bytes we want (and can) read. ssize_t bytes_to_read = max(0, min(strlen(support) - offset, nbyte)); // Perform the read. diff --git a/mentos/src/mem/kheap.c b/mentos/src/mem/kheap.c index c3e2435..f09ed31 100644 --- a/mentos/src/mem/kheap.c +++ b/mentos/src/mem/kheap.c @@ -846,7 +846,6 @@ void kheap_dump() (char *)it + OVERHEAD + blkmngr_get_real_size(it->size)); total += blkmngr_get_real_size(it->size); total_overhead += OVERHEAD; - it = it->next; } pr_debug("\nTotal usable bytes : %d", total); @@ -857,4 +856,5 @@ void kheap_dump() pr_debug("(%p)->", it); } pr_debug("\n\n"); + (void) total, (void) total_overhead; } diff --git a/programs/CMakeLists.txt b/programs/CMakeLists.txt index 5375487..4725591 100644 --- a/programs/CMakeLists.txt +++ b/programs/CMakeLists.txt @@ -25,7 +25,6 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-pragmas") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-command-line-argument") # Set the compiler options. diff --git a/programs/tests/CMakeLists.txt b/programs/tests/CMakeLists.txt index de1607a..60811ca 100644 --- a/programs/tests/CMakeLists.txt +++ b/programs/tests/CMakeLists.txt @@ -25,7 +25,6 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-pragmas") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-command-line-argument") # Set the compiler options. diff --git a/programs/tests/t_sigfpe.c b/programs/tests/t_sigfpe.c index f8739d5..ed03944 100644 --- a/programs/tests/t_sigfpe.c +++ b/programs/tests/t_sigfpe.c @@ -46,4 +46,5 @@ int main(int argc, char *argv[]) d /= e; e -= 1; } + printf("d: %d, e: %d\n", d, e); } diff --git a/programs/tests/t_siginfo.c b/programs/tests/t_siginfo.c index b84e76c..8b285db 100644 --- a/programs/tests/t_siginfo.c +++ b/programs/tests/t_siginfo.c @@ -47,4 +47,5 @@ int main(int argc, char *argv[]) d /= e; e -= 1; } + printf("d: %d, e: %d\n", d, e); }