From 90eb6653f36018ff99107958db0f7bd98c3c0aad Mon Sep 17 00:00:00 2001 From: Cebtenzzre Date: Thu, 14 Sep 2023 17:02:01 -0400 Subject: [PATCH] examples : fix extra ';' after function definitions (-Wextra-semi) --- CMakeLists.txt | 1 + Makefile | 2 +- examples/llama-bench/llama-bench.cpp | 4 ++-- examples/train-text-from-scratch/train-text-from-scratch.cpp | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 205fabea8..711287f48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -435,6 +435,7 @@ if (LLAMA_ALL_WARNINGS) ${warning_flags} -Wmissing-declarations -Wmissing-noreturn + -Wextra-semi ) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # clang++ only set(cxx_flags ${cxx_flags} -Wmissing-prototypes) diff --git a/Makefile b/Makefile index 7a82b76be..3dd93d015 100644 --- a/Makefile +++ b/Makefile @@ -176,7 +176,7 @@ endif # LLAMA_DISABLE_LOGS WARN_FLAGS = -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function MK_CFLAGS += $(WARN_FLAGS) -Wdouble-promotion -Wshadow -Wstrict-prototypes -Wpointer-arith -Wmissing-prototypes \ -Werror=implicit-int -MK_CXXFLAGS += $(WARN_FLAGS) -Wmissing-declarations -Wmissing-noreturn +MK_CXXFLAGS += $(WARN_FLAGS) -Wmissing-declarations -Wmissing-noreturn -Wextra-semi # TODO(cebtenzzre): remove this once PR #2632 gets merged TTFS_CXXFLAGS = $(CXXFLAGS) -Wno-missing-declarations diff --git a/examples/llama-bench/llama-bench.cpp b/examples/llama-bench/llama-bench.cpp index 34ddfde39..6bb2c61aa 100644 --- a/examples/llama-bench/llama-bench.cpp +++ b/examples/llama-bench/llama-bench.cpp @@ -606,9 +606,9 @@ struct printer { virtual ~printer() {} FILE * fout; - virtual void print_header(const cmd_params & params) { (void) params; }; + virtual void print_header(const cmd_params & params) { (void) params; } virtual void print_test(const test & t) = 0; - virtual void print_footer() { }; + virtual void print_footer() { } }; struct csv_printer : public printer { diff --git a/examples/train-text-from-scratch/train-text-from-scratch.cpp b/examples/train-text-from-scratch/train-text-from-scratch.cpp index 59c90c7ba..73881950c 100644 --- a/examples/train-text-from-scratch/train-text-from-scratch.cpp +++ b/examples/train-text-from-scratch/train-text-from-scratch.cpp @@ -497,7 +497,7 @@ struct hash_map * new_hash_map() { result->vals[i] = NULL; } return result; -}; +} void free_hash_map(struct hash_map * map) { delete map; @@ -594,7 +594,7 @@ struct ggml_tensor * ggml_recompute_graph_node( ggml_format_name(clone, "%s (clone)", ggml_get_name(node)); return clone; -}; +} void ggml_build_backward_gradient_checkpointing( struct ggml_context * ctx,