-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
goto definition not working if <attr> is right after <declaration> #13129
Comments
I suspect this is a dupe of #10696 |
@TheBrugne How are you getting that code to compile? With the cl.exe compiler? What args? Is IntellliSense giving any errors? I do not repro the bug when using gcc, in which case there are no IntelliSense errors and it compiles. |
Hello Sean, The project runs on a cortex m23 custom device, compiled with armclang 6.16 and the compiler is parsing correctly the attribute placed on the right of function. Of course I cannot select armclang as compiler in vscode, so this is my setup: { Thank for your support. |
@TheBrugne Are you not able to set your compilerPath to the arm clang compiler? Does it not support the query flags? If that's the case, then you should set the compilerPath to "" and not to the cl.exe, which will cause it to compile in a different compiler mode which doesn't accept the gcc attributes. And set the intelliSenseMode to "windows-clang-arm" or "windows-clang-arm64". |
Many Thank you Sean, you solution is working! Regards |
Environment
Bug Summary and Steps to Reproduce
c/c++ intellisense: goto definition is not working on functions defined in .c that have attributes right after the function prototype in the header file. It goes to the declaration instead.
Example:
If I move the
__attribute__((always_inline))
on the left of the function prototype, everything works fine, but I heard that starting from c23, the new standard is to place attributes right after the function prototype.With older version of intellisense (such as the 1.0.0 of 4years ago) the behavior is good.
Am I missing something?
Configuration and Logs
Other Extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: