diff --git a/Userland/allocate.cpp b/Userland/allocate.cpp index 90f89248aa..fe6d19b3e2 100644 --- a/Userland/allocate.cpp +++ b/Userland/allocate.cpp @@ -13,7 +13,7 @@ enum Unit { Bytes, KiloBytes, MegaBytes }; int main(int argc, char** argv) { - unsigned count = 50; + int count = 50; Unit unit = MegaBytes; if (argc >= 2) { diff --git a/Userland/crash.cpp b/Userland/crash.cpp index d5bd313539..65cbb406b0 100644 --- a/Userland/crash.cpp +++ b/Userland/crash.cpp @@ -55,6 +55,7 @@ int main(int argc, char** argv) volatile int lala = 10; volatile int zero = 0; volatile int test = lala / zero; + (void)test; ASSERT_NOT_REACHED(); } @@ -71,6 +72,7 @@ int main(int argc, char** argv) if (mode == ReadFromUninitializedMallocMemory) { auto* uninitialized_memory = (volatile dword**)malloc(1024); volatile auto x = uninitialized_memory[0][0]; + (void)x; ASSERT_NOT_REACHED(); } @@ -78,6 +80,7 @@ int main(int argc, char** argv) auto* uninitialized_memory = (volatile dword**)malloc(1024); free(uninitialized_memory); volatile auto x = uninitialized_memory[4][0]; + (void)x; ASSERT_NOT_REACHED(); } diff --git a/Userland/ls.cpp b/Userland/ls.cpp index f5655ac6a5..9c2c690c8e 100644 --- a/Userland/ls.cpp +++ b/Userland/ls.cpp @@ -57,7 +57,7 @@ int main(int argc, char** argv) return do_file_system_object_short(path); }; - int status; + int status = 0; if (optind >= argc) { status = do_file_system_object("."); } else if (optind + 1 >= argc) { diff --git a/Userland/sort.cpp b/Userland/sort.cpp index 543a1185c3..e2bc08ad74 100644 --- a/Userland/sort.cpp +++ b/Userland/sort.cpp @@ -6,6 +6,9 @@ int main(int argc, char** argv) { + UNUSED_PARAM(argc); + UNUSED_PARAM(argv); + Vector lines; for (;;) { diff --git a/Userland/tail.cpp b/Userland/tail.cpp index be474837e4..a1b8b03620 100644 --- a/Userland/tail.cpp +++ b/Userland/tail.cpp @@ -68,12 +68,6 @@ off_t find_seek_pos(CFile& file, int wanted_lines) return pos; } -static void exit_because_we_wanted_lines() -{ - fprintf(stderr, "Expected a line count after -n"); - exit(1); -} - int main(int argc, char* argv[]) { CArgsParser args_parser("tail"); @@ -108,8 +102,6 @@ int main(int argc, char* argv[]) } bool flag_follow = args.is_present("f"); - bool o_arg = args.is_present("o"); - auto pos = find_seek_pos(f, line_count); return tail_from_pos(f, pos, flag_follow); }