You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AArch inline asm: "unknown register name" clobber list #4382
C/C++ Extension Version: 0.25.1 (problem exist in v0.23.1 too)
No other extensions are installed
AArch-specific (ARM) register names aren't recognized in the clobber list of inline asm statement. Nevertheless the code successfully compiles and works.
To Reproduce
Go to any C function body.
Paste asm("mov w0, #0":::"r0");
See error
Expected behavior
AArch-specific register names must be recognized just like x86's eax, rax and so.
Screenshots
Reacted by Prehistoricman, Guillermo Prandi, Victor, Kemal Afzal, KaiN, Andi Powers-Holmes, Ciro Cattuto, Karsten Nikolai Strand, Altareos, Seungwon Lee and 2 more
It's possible we may also need to add support for ARM IntelliSense mode and -std=gnu11 for all the errors to disappear (we have other issues tracking those).
During WFH about half the developers I work with have been using VSCode and the other half don't use GUI IDEs. A few of us do Linux kernel module development for ARM and MIPS. There is a macro called get_user that obtains one scalar value from user space, and on ARM it expands to inline assembly referencing r0. Every file that has a get_user macro in gets tagged as a problem.
Same issue - I included "eax" just for demonstration. I would have thought that changing intelliSenseMode to "gcc-arm" would fix this. Intellisense is only recognising x86 registers.
I have similar problem, but not in ARM GCC compiler, but in Motorola 68000 one. I see this issue is marked as "Done" in 1.11 - is the fix applicable for ARM only, or does it fix the root of the problem for other architectures too?
unfortunately this doesn't work for me under 1.11.4, screenshot taken just now:
same thing with __asm__ directive instead of __asm, albeit it formats the register string way nicer.
I'm using ms-vscode.cpptools, ms-vscode.cmake-tools and 68000 GCC compiler bundled with bartmanabyss.amiga-debug extension. I understand that you may not want to set up such exotic configuration - can you give me any pointers on how can I find the point of failure for you?
Victor (@Victor333Huesca) Yes, the error wasn't fixed for register declarations -- we have a potential fix for our next pre-release, pending code review.
Activity
sean-mcmanus commentedon Oct 15, 2019
Thanks for reporting this. I reported it to the VS team at https://developercommunity.visualstudio.com/content/problem/778258/cc-intellisense-shows-unknown-register-name-with-a.html .
It's possible we may also need to add support for ARM IntelliSense mode and -std=gnu11 for all the errors to disappear (we have other issues tracking those).
cardiffman commentedon May 1, 2020
During WFH about half the developers I work with have been using VSCode and the other half don't use GUI IDEs. A few of us do Linux kernel module development for ARM and MIPS. There is a macro called get_user that obtains one scalar value from user space, and on ARM it expands to inline assembly referencing r0. Every file that has a get_user macro in gets tagged as a problem.
sean-mcmanus commentedon May 1, 2020
cardiffman (@cardiffman) If you can edit the macro, you may be able to avoid the errors via surrounding the code in a
cardiffman commentedon May 1, 2020
Interesting idea. It makes sense that you would have a macro defined to help with that.
guillep2k commentedon May 27, 2020
Happens the same with ARM7:
cpptools version: 0.28.1
VSCode version:
Snippets:
Or declaring registers in the clobber section:
Prehistoricman commentedon Nov 6, 2020
Same issue - I included "eax" just for demonstration. I would have thought that changing intelliSenseMode to "gcc-arm" would fix this. Intellisense is only recognising x86 registers.
sean-mcmanus commentedon Nov 6, 2020
I think the VS issue at https://developercommunity.visualstudio.com/content/problem/778258/cc-intellisense-shows-unknown-register-name-with-a.html may need more upvotes.
attzonko commentedon Feb 23, 2021
I see the same issue when trying to access ARM registers:

Here is the example from the arm docs with exactly the same register:

15 remaining items
tehKaiN commentedon Jun 25, 2022
Hi,
I have similar problem, but not in ARM GCC compiler, but in Motorola 68000 one. I see this issue is marked as "Done" in 1.11 - is the fix applicable for ARM only, or does it fix the root of the problem for other architectures too?
sean-mcmanus commentedon Jun 27, 2022
KaiN (@tehKaiN) The fix will work for all architectures.
sean-mcmanus commentedon Jul 8, 2022
This fix is available with 1.11.2 (pre-release): https://github.com/microsoft/vscode-cpptools/releases
tehKaiN commentedon Jul 22, 2022
unfortunately this doesn't work for me under 1.11.4, screenshot taken just now:
same thing with
__asm__directive instead of__asm, albeit it formats the register string way nicer.I'm using ms-vscode.cpptools, ms-vscode.cmake-tools and 68000 GCC compiler bundled with bartmanabyss.amiga-debug extension. I understand that you may not want to set up such exotic configuration - can you give me any pointers on how can I find the point of failure for you?
sean-mcmanus commentedon Jul 22, 2022
KaiN (@tehKaiN) Sorry about that -- looks like the "asm("mov w0, #0":::"r0");" case got fixed but not the other case.
sean-mcmanus commentedon Jul 22, 2022
KaiN (@tehKaiN) I've opened a new issue to track that case: #9627
Victor333Huesca commentedon Jul 22, 2022
Yes, I do confirm that the inline asm is fixed with arm, thanks!
But, the asm register is still reporting an error on my side too.
PS: I upvoted the new issue.
sean-mcmanus commentedon Jul 22, 2022
Victor (@Victor333Huesca) Yes, the error wasn't fixed for register declarations -- we have a potential fix for our next pre-release, pending code review.
sean-mcmanus commentedon Jul 28, 2022
KaiN (@tehKaiN) Victor (@Victor333Huesca) The register declaration issue is fixed with 1.12.0 (pre-release): https://github.com/microsoft/vscode-cpptools/releases/tag/v1.12.0