File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -414,10 +414,11 @@ if (LLAMA_ALL_WARNINGS)
414
414
-Wextra
415
415
-Wpedantic
416
416
-Wcast-qual
417
- -Wunreachable-code-break
418
- -Wunreachable-code-return
419
- -Wextra-semi
417
+ -Wno-unused-function
420
418
)
419
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" ) # clang++ only
420
+ set (warning_flags ${warning_flags} -Wunreachable-code-break -Wunreachable-code-return )
421
+ endif ()
421
422
set (c_flags
422
423
${warning_flags}
423
424
-Wdouble-promotion
@@ -426,17 +427,15 @@ if (LLAMA_ALL_WARNINGS)
426
427
-Wpointer-arith
427
428
-Wmissing-prototypes
428
429
-Werror=implicit-int
429
- -Wno-unused-function
430
430
)
431
431
set (cxx_flags
432
432
${warning_flags}
433
433
-Wmissing-declarations
434
434
-Wmissing-noreturn
435
- -Wrange-loop-bind-reference
436
- -Wno-unused-function
435
+ -Wextra-semi
437
436
)
438
437
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" ) # clang++ only
439
- set (cxx_flags ${cxx_flags} -Wmissing-prototypes )
438
+ set (cxx_flags ${cxx_flags} -Wmissing-prototypes -Wrange-loop-bind-reference )
440
439
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) # g++ only
441
440
set (cxx_flags ${cxx_flags} -Wno-format-truncation -Wno-array-bounds )
442
441
endif ()
Original file line number Diff line number Diff line change @@ -170,18 +170,18 @@ ifdef LLAMA_DISABLE_LOGS
170
170
endif # LLAMA_DISABLE_LOGS
171
171
172
172
# warnings
173
- WARN_FLAGS = -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wunreachable-code-break \
174
- -Wunreachable-code-return -Wextra-semi
173
+ WARN_FLAGS = -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function
175
174
MK_CFLAGS += $(WARN_FLAGS ) -Wdouble-promotion -Wshadow -Wstrict-prototypes -Wpointer-arith -Wmissing-prototypes \
176
175
-Werror=implicit-int
177
- MK_CXXFLAGS += $(WARN_FLAGS ) -Wmissing-declarations -Wmissing-noreturn -Wrange-loop-bind-reference
176
+ MK_CXXFLAGS += $(WARN_FLAGS ) -Wmissing-declarations -Wmissing-noreturn -Wextra-semi
178
177
179
178
# TODO(cebtenzzre): remove this once PR #2632 gets merged
180
179
TTFS_CXXFLAGS = $(CXXFLAGS ) -Wno-missing-declarations
181
180
182
181
ifneq '' '$(findstring clang,$(shell $(CXX ) --version) ) '
183
182
# clang++ only
184
- MK_CXXFLAGS += -Wmissing-prototypes
183
+ WARN_FLAGS += -Wunreachable-code-break -Wunreachable-code-return
184
+ MK_CXXFLAGS += -Wmissing-prototypes -Wrange-loop-bind-reference
185
185
TTFS_CXXFLAGS += -Wno-missing-prototypes
186
186
else
187
187
# g++ only
You can’t perform that action at this time.
0 commit comments