Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix misleading-indentation compilation error under clang 10 #33406

Merged
merged 1 commit into from
Mar 10, 2020

Conversation

omajid
Copy link
Member

@omajid omajid commented 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.

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.
@omajid omajid force-pushed the misleading-indentation branch from 91071a5 to c3c67a6 Compare March 10, 2020 00:15
@omajid omajid changed the title Fix misleading-error compilation error under clang 10 Fix misleading-indentation compilation error under clang 10 Mar 10, 2020
@jkotas jkotas merged commit 29cd9a5 into dotnet:master Mar 10, 2020
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
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants