Fix misleading-indentation compilation error under clang 10#33406
Merged
jkotas merged 1 commit intodotnet:masterfrom Mar 10, 2020
Merged
Fix misleading-indentation compilation error under clang 10#33406jkotas merged 1 commit intodotnet:masterfrom
jkotas merged 1 commit intodotnet:masterfrom
Conversation
danmoseley
approved these changes
Mar 9, 2020
The error looks like this (seen in dotnet/coreclr repo):
In file included from /root/coreclr/src/ildasm/dasm_mi.cpp:7:
/root/coreclr/src/ildasm/exe/../../tools/metainfo/mdinfo.cpp:1951:9: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
if (!wcscmp(W("__DecoratedName"), rcName))
^
/root/coreclr/src/ildasm/exe/../../tools/metainfo/mdinfo.cpp:1947:5: note: previous statement is here
if (pSig && pMethName)
^
1 error generated.
91071a5 to
c3c67a6
Compare
omajid
added a commit
to omajid/dotnet-coreclr
that referenced
this pull request
Mar 11, 2020
This fixes 3 different set of build issues are seen when compiling with clang 10. - Clang 10 fails to compile slist.h because the code contained is actually invalid. The assignment operator being used doesn't exist. This is a backport of dotnet/runtime#33096 - Clang 10 has moved exception-handling mismatches in function declarations under the -fms-compatibility flag (instead of the -fms-extensions flag). Our declarations of atoll and other similar functions are missing the exception declaration `throw()`. This mismatch in exception declarations makes clang 10 unable to build this code. Fix it by defining THROW_DECL as `throw()` which is supported at least as far back as clang 3.3. This is a backport of dotnet/runtime#32837 - Clang 10 has enabled (or made default?) the `misleading-indentation` warning which causes errors when trying to compile code in src/tools/metainfo/mdinfo.cpp. This is a backport of dotnet/runtime#33406
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The error looks like this (seen in dotnet/coreclr repo):