How to turn off gratuitious insertions of "#include <cstdint>"

Clion keeps inserting "#include <cstdint>" at the tops of C++ files or headers that I'm working on, without any warning.

Every time it does this, it breaks my code and I get typedef redefiniton errors on my next build.   (<cstdint> is not 100% compatible with <stdint.h>)

How do I turn this unwanted feature off?  I can't find anything in the settings that describes this.

4

Sorry for the inconvenience! You can turn off auto-import pop-ups via Editor | General | Auto-import. The pop-up with include suggestion won’t show up in that case, though you’ll still be able to invoke an auto-import when necessary using an intention action (Alt+Enter). Unfortunately, there is no option to turn off auto-import completely. Please comment or upvote the issue in our tracker: https://youtrack.jetbrains.com/issue/CPP-5536.

0
Avatar
Permanently deleted user

Hi Anna,

Thanks for your response, but I'm afraid it does NOT solve the issue.

First,  the setting Editor | General | Auto-import | C/C++ | Show import popup is already turned off, but the extra #includes are being inserted anyway.

Second,  THERE IS NO POPUP!  Whenever I type a variable declaration using a standard type like e.g., uint16_t, and if there previously had not been any ueage of that type in the file being edited, CLion doesn't "suggest" anything or ask permission, it just goes ahead and inserts the #include at or near the top of the file.  It does so completely silently.

2

请先登录再写评论。