diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2025-06-30 16:04:55 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-30 23:04:55 +0000 |
| commit | 7a6a455f182722a42fcba5a2fc57c0cd524c4764 (patch) | |
| tree | 7da109b6a22a062c37cf28cc22ed852d5baa2f48 | |
| parent | 0f098b9d27a859add3d62d2e82b699341d5ce895 (diff) | |
Allow a compiler warning on MacOS (#7561)
This PR is to allow a compiler warning even when all warnings
are requested to be treated as errors.
The following pattern is very common in Slang code base:
if (auto var = as<...>(...))
And when `var` is not used, the compiler prints a warning.
Alternatively we can remove `auto var =` part but there are too many.
Co-authored-by: Jay Kwak <jkwak@jkwak-mlt.client.nvidia.com>
| -rw-r--r-- | cmake/CompilerFlags.cmake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cmake/CompilerFlags.cmake b/cmake/CompilerFlags.cmake index 2019b554b..afd0760f6 100644 --- a/cmake/CompilerFlags.cmake +++ b/cmake/CompilerFlags.cmake @@ -112,10 +112,13 @@ function(set_default_compile_options target) -Wno-invalid-offsetof -Wno-newline-eof -Wno-return-std-move - # Enabled warnings: + # Allowed warnings: # If a function returns an address/reference to a local, we want it to # produce an error, because it probably means something very bad. -Werror=return-local-addr + # Allow unused variables with a pattern of `if (auto v = as<...>(...))`. + # This pattern is very common in Slang code base. + -Wno-error=unused-but-set-variable # Some warnings which are on by default in MSVC -Wnarrowing ) |
