diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2022-11-17 03:33:10 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-16 11:33:10 -0800 |
| commit | 09d8e048d2264d89886cda8e87e8a452d4f913c1 (patch) | |
| tree | de925c032837ae21e7693e3c44a1c825c5fd3e6e | |
| parent | 8d500475bb11b025960bf211d505540867ce68e7 (diff) | |
Squash warnings (#2515)
* Don't use uname -p
It's not portable (doesn't work on my machine)
* Disable maybe-uninitialized warning on gcc
Only false positives at the moment
* Squash warning in miniz
Allow it to use 64 bit file handing functions with gcc
* Use noreturn c++11 attribute in SLANG_RETURN_NEVER
* Squash uninitialized variable warnings
* Squash const char/char conversion warnings
Co-authored-by: Yong He <yonghe@outlook.com>
| -rw-r--r-- | github_test.sh | 2 | ||||
| -rw-r--r-- | premake5.lua | 7 | ||||
| -rw-r--r-- | slang.h | 2 | ||||
| -rw-r--r-- | source/slang/slang-ir-diff-jvp.cpp | 1 | ||||
| -rw-r--r-- | source/slang/slang-legalize-types.h | 2 | ||||
| -rw-r--r-- | tools/gfx-unit-test/shader-cache-tests.cpp | 4 |
6 files changed, 11 insertions, 7 deletions
diff --git a/github_test.sh b/github_test.sh index b18566f84..dc07c6250 100644 --- a/github_test.sh +++ b/github_test.sh @@ -9,7 +9,7 @@ else fi PLATFORM=$(uname -s | tr '[:upper:]' '[:lower:]') -ARCHITECTURE=$(uname -p) +ARCHITECTURE=$(uname -m) # Darwin is actually macosx (for paths etc) if [ "${PLATFORM}" == "darwin" ]; then diff --git a/premake5.lua b/premake5.lua index f5a86126e..92243263a 100644 --- a/premake5.lua +++ b/premake5.lua @@ -339,8 +339,9 @@ newoption { filter { "toolset:clang or gcc*", "language:C++" } buildoptions { "-Wno-reorder", "-Wno-class-memaccess"} - filter { "toolset:gcc*"} - buildoptions { "-Wno-implicit-fallthrough" } + filter { "toolset:gcc*" } + buildoptions { "-Wno-implicit-fallthrough", "-Wno-maybe-uninitialized" } + filter { "toolset:clang" } buildoptions { "-Wno-deprecated-register", "-Wno-tautological-compare", "-Wno-missing-braces", "-Wno-undefined-var-template", "-Wno-unused-function", "-Wno-return-std-move", "-Wno-ignored-optimization-argument", "-Wno-unknown-warning-option" } @@ -1501,6 +1502,8 @@ tool "slangd" "external/miniz/miniz_tinfl.c", "external/miniz/miniz_zip.c" } + filter { "system:linux" } + defines { "_LARGEFILE64_SOURCE" } filter { "system:linux or macosx" } links { "dl"} @@ -380,7 +380,7 @@ convention for interface methods. #endif // __cplusplus #ifndef SLANG_RETURN_NEVER -# define SLANG_RETURN_NEVER /* empty */ +# define SLANG_RETURN_NEVER [[noreturn]] #endif // SLANG_RETURN_NEVER /* Macros for detecting processor */ diff --git a/source/slang/slang-ir-diff-jvp.cpp b/source/slang/slang-ir-diff-jvp.cpp index 7f5979a87..1597c80d1 100644 --- a/source/slang/slang-ir-diff-jvp.cpp +++ b/source/slang/slang-ir-diff-jvp.cpp @@ -2515,6 +2515,7 @@ struct BackwardDiffTranscriber newInst = builder->emitDiv(resultType, primalLeft, primalRight); break; default: + newInst = nullptr; getSink()->diagnose(origArith->sourceLoc, Diagnostics::unimplemented, "this arithmetic instruction cannot be differentiated"); diff --git a/source/slang/slang-legalize-types.h b/source/slang/slang-legalize-types.h index 600f1d7a7..a24caf960 100644 --- a/source/slang/slang-legalize-types.h +++ b/source/slang/slang-legalize-types.h @@ -73,7 +73,7 @@ struct LegalType Flavor flavor = Flavor::none; RefPtr<RefObject> obj; - IRType* irType; + IRType* irType = nullptr; static LegalType simple(IRType* type) { diff --git a/tools/gfx-unit-test/shader-cache-tests.cpp b/tools/gfx-unit-test/shader-cache-tests.cpp index a9939d434..a7306599a 100644 --- a/tools/gfx-unit-test/shader-cache-tests.cpp +++ b/tools/gfx-unit-test/shader-cache-tests.cpp @@ -271,7 +271,7 @@ namespace gfx_test { ComPtr<IShaderProgram> shaderProgram; slang::ProgramLayout* slangReflection; - char* shaderFilename; + const char* shaderFilename; switch (shaderIndex) { case 0: @@ -361,7 +361,7 @@ namespace gfx_test { ComPtr<IShaderProgram> shaderProgram; slang::ProgramLayout* slangReflection; - char* entryPointName; + const char* entryPointName; switch (shaderIndex) { case 0: |
