CLion does not recognize IAR keyword ramfunc


I use the IAR compiler in CLion, and frequently use the keyword __ramfunc to declare functions to execute from RAM.  CLion registers this as a problem. Is there any way I can suppress this 'problem' message?


It compiles fine...using IAR compiler with CLion.  __ramfunc is an IAR builtin that as best as I can tell is not defined in a header. My issue is not that I cannot compile, my issue is that everywhere I use __ramfunc, I get squiggles and the Unknown type name '__ramfunc' message, which is not an error message or warning emitted from IAR, it is from CLion. Is there some way of supressing this message?


Edit: Someone posted a response to this comment, then deleted it, so for context, here was the original comment that this comment was in response to:

If you don't include the header declaring the function you use, the compiler has no idea what you are trying to call. This has nothing to do with your IDE btw (CLion or something else). That's just basic C++. Include what you use.



What CLion version do you use? 

Also please attach a screenshot of your toolchain from `File | Settings | Build, Execution, Deployment | Toolchains`.


I am currently using 2022.1.1.  As a side note I had to downgrade.  This has been an issue for as long as I have used CLion with IAR compiler, so all 2021 versions at least were affected.



And here is an example of the "error squiggles" I get in the editor:



And the problems tab in CLion is filled with this:


My projects compile fine, it is a nuisance to have the problem repeatedly pop up in the problems window.


One of the comments on that youtrack issue provided me with a solution...

I added "-D__ramfunc=" to the list of flags passed to Clangd (under Settings->Languages & Frameworks->C/C++->Clangd


Thanks Anna.



Thank you for the update! I'm glad you found a workaround.


Please sign in to leave a comment.