summaryrefslogtreecommitdiffstats
path: root/source/compiler-core
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2023-04-27 12:36:59 +0800
committerGitHub <noreply@github.com>2023-04-26 21:36:59 -0700
commit3acbe8145c60f4d1e7a180b4602a94269a489df5 (patch)
tree8031e7ca897260ac3ab6d2a920864f3114bc8668 /source/compiler-core
parenta3da31c189a1cc9bdf85a42ac359b8c2777f3550 (diff)
Fix most of the disabled warnings on gcc/clang (#2839)
Diffstat (limited to 'source/compiler-core')
-rw-r--r--source/compiler-core/slang-artifact-desc-util.cpp2
-rw-r--r--source/compiler-core/slang-artifact-handler-impl.cpp3
-rw-r--r--source/compiler-core/slang-doc-extractor.cpp2
-rw-r--r--source/compiler-core/slang-downstream-compiler-util.cpp1
-rw-r--r--source/compiler-core/slang-json-lexer.cpp7
-rw-r--r--source/compiler-core/slang-visual-studio-compiler-util.cpp5
6 files changed, 12 insertions, 8 deletions
diff --git a/source/compiler-core/slang-artifact-desc-util.cpp b/source/compiler-core/slang-artifact-desc-util.cpp
index 140ac780d..18558eab9 100644
--- a/source/compiler-core/slang-artifact-desc-util.cpp
+++ b/source/compiler-core/slang-artifact-desc-util.cpp
@@ -945,7 +945,7 @@ SlangResult ArtifactDescUtil::appendDefaultExtension(const ArtifactDesc& desc, S
{
StringBuilder buf;
appendText(desc, buf);
- return buf;
+ return std::move(buf);
}
} // namespace Slang
diff --git a/source/compiler-core/slang-artifact-handler-impl.cpp b/source/compiler-core/slang-artifact-handler-impl.cpp
index 5d2a74036..6fc96dc44 100644
--- a/source/compiler-core/slang-artifact-handler-impl.cpp
+++ b/source/compiler-core/slang-artifact-handler-impl.cpp
@@ -29,8 +29,9 @@ namespace Slang {
SlangResult DefaultArtifactHandler::queryInterface(SlangUUID const& uuid, void** outObject)
{
- if (auto ptr = getInterface(uuid))
+ if ([[maybe_unused]] auto ptr = getInterface(uuid))
{
+ SLANG_ASSERT(ptr == this);
addRef();
*outObject = static_cast<IArtifactHandler*>(this);
return SLANG_OK;
diff --git a/source/compiler-core/slang-doc-extractor.cpp b/source/compiler-core/slang-doc-extractor.cpp
index c2d36ee89..ca947c94f 100644
--- a/source/compiler-core/slang-doc-extractor.cpp
+++ b/source/compiler-core/slang-doc-extractor.cpp
@@ -717,8 +717,6 @@ SlangResult DocMarkupExtractor::extract(const SearchItemInput* inputs, Index inp
{
struct Entry
{
- typedef Entry ThisType;
-
Index viewIndex; ///< The view/file index this loc is found in
SourceLoc::RawValue locOrOffset; ///< Can be a loc or an offset into the file
diff --git a/source/compiler-core/slang-downstream-compiler-util.cpp b/source/compiler-core/slang-downstream-compiler-util.cpp
index 9f43a6c88..d00c3fecb 100644
--- a/source/compiler-core/slang-downstream-compiler-util.cpp
+++ b/source/compiler-core/slang-downstream-compiler-util.cpp
@@ -41,7 +41,6 @@ struct DownstreamCompilerInfos
{
typedef DownstreamCompilerInfo Info;
typedef Info::SourceLanguageFlag SourceLanguageFlag;
- typedef Info::SourceLanguageFlags SourceLanguageFlags;
DownstreamCompilerInfos infos;
diff --git a/source/compiler-core/slang-json-lexer.cpp b/source/compiler-core/slang-json-lexer.cpp
index 428afca63..0476ca37a 100644
--- a/source/compiler-core/slang-json-lexer.cpp
+++ b/source/compiler-core/slang-json-lexer.cpp
@@ -156,7 +156,6 @@ JSONTokenType JSONLexer::advance()
{
// Line comment
cursor = _lexLineComment(cursor);
- break;
}
else if (nextChar == '*')
{
@@ -166,8 +165,12 @@ JSONTokenType JSONLexer::advance()
{
return _setInvalidToken();
}
- break;
}
+ else
+ {
+ return _setInvalidToken();
+ }
+ break;
}
case ' ':
case '\t':
diff --git a/source/compiler-core/slang-visual-studio-compiler-util.cpp b/source/compiler-core/slang-visual-studio-compiler-util.cpp
index 32b4d7f25..81e00d73e 100644
--- a/source/compiler-core/slang-visual-studio-compiler-util.cpp
+++ b/source/compiler-core/slang-visual-studio-compiler-util.cpp
@@ -462,7 +462,10 @@ static SlangResult _parseVisualStudioLine(SliceAllocator& allocator, const Unown
return SLANG_OK;
}
-/* static */SlangResult VisualStudioCompilerUtil::locateCompilers(const String& path, ISlangSharedLibraryLoader* loader, DownstreamCompilerSet* set)
+/* static */SlangResult VisualStudioCompilerUtil::locateCompilers(
+ const String& path,
+ ISlangSharedLibraryLoader* loader,
+ [[maybe_unused]] DownstreamCompilerSet* set)
{
SLANG_UNUSED(loader);