Suppress MS-style inline assembly clang-tidy error
See original GitHub issueHi,
I am getting the following error from clang pretty often:
MS-style inline assembly is not available: Unable to find target for this triple (no targets are registered) [clang-diagnostic-error]
I know this is a problem from clang, see https://reviews.llvm.org/D17981. They don’t seem to want to fix this anytime soon… It would be pretty annoying for people to compile LLVM + Clang from scratch and apply the above patch locally just to remove this error. Would it be possible to just filter this one out?
Kind regards,
Jacob
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Ignore inline assembly related diagnostic errors in clang-tidy
I am trying to use clang-tidy (version 6.0.0) to run some static analysis on a code base that is supposed to run on...
Read more >Clang-tidy and Clazy analyzer does not work with MSVC ...
With clang-tidy, it fails with errors like: C:\Program Files ... error: MS-style inline assembly is not available: Unable to find target for ...
Read more >⚙ D17981 [clang-tidy] Fix clang-tidy to support parsing of ...
Summary: Clang-tidy fails when parsing MSVC inline assembly statements. The native target and asm parser aren't initialized.
Read more >⚙ D149579 [X86][MC] Fix parsing Intel syntax indirect ...
I'm aware of the check-clang failure in CodeGen/ms-inline-asm-functions.c. It seems to be caused by the MS inline assembly being translated ...
Read more >[llvm-dev] [inline-asm][asm-goto] Supporting ...
Analyzing symbols defined/references in the inline assembly (Bug 28970), taking into account module/file-scope inline assembly. 3. Provide some information ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The only way to resolve it is building llvm and clang-tidy from source and applying the patch described at https://reviews.llvm.org/D17981. The side effect is that your binaries are a bit larger (/care)
The error more specifically:
This is on visual studio 2017 by the way, but i also had this on my own tooling on earlier versions. This probably requires a windows.h include.
Edit:
I found the cause, its related to passing -m32 as additional compile flag. Our code only compiles with 32bit, due to some code static_asserting we are actually compiling 32 bit.