#ifdef parsing

Answered

Code that is currently "inactive" because the #ifdef clause fails is not seen by "usages", which is causing me trouble since I do have a number of preprocessor-defined blocks of code for platform specific actions. A big part of the reason that I started using CLion is because I want to see if it will suit me well for my workflow and having large sections of code controlled by the likes of #ifdef PLATFORM_WEB is a must, and it would be very helpful if CLion could actually see inside those areas.

It seems that most refactoring options work, like Rename.. but I need a toggle to parse all of that code aswell. The attached image clearly shows that the only 2 usages of this function are in the while loop (in the failed case of if defined) and the function's own prototype (not pictured but easily inferred from the list.) If there is something I can do, please help!

0
3 comments

Hello!

Not sure I got your question correctly.

Code that is currently "inactive" because the #ifdef clause fails is not seen by "usages"

CLion should properly mark conditionally uncompiled code in accordance with #if/#ifdef and defines. And indeed CLion doesn't provide all smart code features for conditionally uncompiled code.

Do you want smart code features to be provided for conditionally uncompiled code?

1

Yes! I would prefer to have the smart-code features available for the conditional code, and it would be best if I didn't have to temporarilly place #define tags at the start of a file each time I try to use one :P

0

Please sign in to leave a comment.