build : silence misleading -Warray-bounds warning
There is a -Warray-bounds warning from g++ 13.2.1 in test-llama-grammar.cpp that is a false-positive because there is a ternary that special-cases zero in the std::vector code. /usr/include/c++/13.2.1/bits/stl_algobase.h:398:17: warning: array subscript 0 is outside array bounds of ‘const llama_grammar_element* [0]’ [-Warray-bounds=] 398 | { *__to = *__from; } | ~~~~~~^~~~~~~~~
This commit is contained in:
parent
9e2023156e
commit
ceee3a6c22
2 changed files with 2 additions and 2 deletions
|
@ -423,7 +423,7 @@ if (LLAMA_ALL_WARNINGS)
|
|||
)
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# g++ only
|
||||
set(cxx_flags ${cxx_flags} -Wno-format-truncation)
|
||||
set(cxx_flags ${cxx_flags} -Wno-format-truncation -Wno-array-bounds)
|
||||
endif()
|
||||
else()
|
||||
# todo : msvc
|
||||
|
|
2
Makefile
2
Makefile
|
@ -123,7 +123,7 @@ MK_CXXFLAGS += -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wno-m
|
|||
|
||||
ifeq '' '$(findstring clang++,$(CXX))'
|
||||
# g++ only
|
||||
MK_CXXFLAGS += -Wno-format-truncation
|
||||
MK_CXXFLAGS += -Wno-format-truncation -Wno-array-bounds
|
||||
endif
|
||||
|
||||
# OS specific
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue