forked from nomic-ai/gpt4all
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Establish basic compiler warnings, and fix a few style issues (nomic-…
…ai#3039) Signed-off-by: Jared Van Bortel <[email protected]>
- Loading branch information
1 parent
3165e1d
commit 8e3108f
Showing
12 changed files
with
71 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
function(gpt4all_add_warning_options target) | ||
if (MSVC) | ||
return() | ||
endif() | ||
target_compile_options("${target}" PRIVATE | ||
# base options | ||
-Wall | ||
-Wextra | ||
# extra options | ||
-Wcast-align | ||
-Wextra-semi | ||
-Wformat=2 | ||
-Wmissing-include-dirs | ||
-Wnull-dereference | ||
-Wstrict-overflow=2 | ||
-Wvla | ||
# errors | ||
-Werror=format-security | ||
-Werror=init-self | ||
-Werror=pointer-arith | ||
-Werror=undef | ||
# disabled warnings | ||
-Wno-sign-compare | ||
-Wno-unused-parameter | ||
-Wno-unused-function | ||
-Wno-unused-variable | ||
) | ||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
target_compile_options("${target}" PRIVATE | ||
-Wduplicated-branches | ||
-Wduplicated-cond | ||
-Wlogical-op | ||
-Wno-reorder | ||
-Wno-null-dereference | ||
) | ||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$") | ||
target_compile_options("${target}" PRIVATE | ||
-Wunreachable-code-break | ||
-Wunreachable-code-return | ||
-Werror=pointer-integer-compare | ||
-Wno-reorder-ctor | ||
) | ||
endif() | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters