Support for language extensions?

First let me say that CLion is proving to be a fantastic tool for managing the huge mess of a code base that I recently inherited.

My question is: Is there a way to "teach"  CLion about oddball language extensions? I'm working with the Analog Devices Blackfin family of processors. The vendor provided C/C++ compiler supports a handful of language extensions to help developers take advantage of the Blackfin architecture. For example the section keyword specifies in which type of memory a piece of code or data is located:

section("L1_data_b")int filter[1024];

defines filter as a array of 1024 ints that is to be located in bank B of level one on board data memory. My problem is CLion flags this line with an error. It's not the end of the world, but it is annoying. I don't want to comment out the section statement because inevitably I'll forget to un-comment it before compilation.

Any thoughts or suggestions?


Comment actions Permalink

Thanks for the positive feedback, Eric.

Unforunatelly, it's not possible to teach CLion to anything non-standard (and teaching C++ parser and resolved is not trivial).
We have a groups of requests under this issue, feel free to leave your suggestion; but to be fair, it's unlikely we we'll get to it soon.

You may try to workaround this, though, by providing an empty custom macro that hides section("") usages, and enable this macro only when unser CLion (you can pass special flag to CMake to detect CLion).

Comment actions Permalink

Thank you Anton for your reply. I'll give your workaround a try. If nothing else it will provide an excuse for learning more about getting the most out of CLion and CMake.


Please sign in to leave a comment.