CLion does not recognize IAR keyword ramfunc

Answered

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?

0
6 comments

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.

0

Hello!

What CLion version do you use? 

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

0

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.

 

Toolchain:

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.

0

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.

 

1

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

0

Please sign in to leave a comment.