Skip to content

Commit 26ea5c2

Browse files
committed
examples : fix extra ';' after function definitions (-Wextra-semi)
1 parent 76d0c8c commit 26ea5c2

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ if (LLAMA_ALL_WARNINGS)
432432
${warning_flags}
433433
-Wmissing-declarations
434434
-Wmissing-noreturn
435+
-Wextra-semi
435436
)
436437
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # clang++ only
437438
set(cxx_flags ${cxx_flags} -Wmissing-prototypes -Wrange-loop-bind-reference)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ endif # LLAMA_DISABLE_LOGS
176176
WARN_FLAGS = -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function
177177
MK_CFLAGS += $(WARN_FLAGS) -Wdouble-promotion -Wshadow -Wstrict-prototypes -Wpointer-arith -Wmissing-prototypes \
178178
-Werror=implicit-int
179-
MK_CXXFLAGS += $(WARN_FLAGS) -Wmissing-declarations -Wmissing-noreturn
179+
MK_CXXFLAGS += $(WARN_FLAGS) -Wmissing-declarations -Wmissing-noreturn -Wextra-semi
180180

181181
# TODO(cebtenzzre): remove this once PR #2632 gets merged
182182
TTFS_CXXFLAGS = $(CXXFLAGS) -Wno-missing-declarations

examples/llama-bench/llama-bench.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,9 @@ struct printer {
606606
virtual ~printer() {}
607607

608608
FILE * fout;
609-
virtual void print_header(const cmd_params & params) { (void) params; };
609+
virtual void print_header(const cmd_params & params) { (void) params; }
610610
virtual void print_test(const test & t) = 0;
611-
virtual void print_footer() { };
611+
virtual void print_footer() { }
612612
};
613613

614614
struct csv_printer : public printer {

examples/train-text-from-scratch/train-text-from-scratch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ struct hash_map * new_hash_map() {
497497
result->vals[i] = NULL;
498498
}
499499
return result;
500-
};
500+
}
501501

502502
void free_hash_map(struct hash_map * map) {
503503
delete map;
@@ -594,7 +594,7 @@ struct ggml_tensor * ggml_recompute_graph_node(
594594
ggml_format_name(clone, "%s (clone)", ggml_get_name(node));
595595

596596
return clone;
597-
};
597+
}
598598

599599
void ggml_build_backward_gradient_checkpointing(
600600
struct ggml_context * ctx,

0 commit comments

Comments
 (0)