Code::Blocks Forums

User forums => Help => Topic started by: purpleferns on January 18, 2024, 04:23:35 pm

Title: Disable Automatic Preprocessor Directives
Post by: purpleferns on January 18, 2024, 04:23:35 pm
I heard that Code::Blocks covers you if you forget to import any preprocessor directives if you use it's functionality. While it's helpful, I'm currently learning C and would rather not pick up that bad habit of forgetting. Is there any way to disable this feature?
Title: Re: Disable Automatic Preprocessor Directives
Post by: stahta01 on January 18, 2024, 07:52:33 pm
https://wiki.codeblocks.org/index.php/FAQ-General#Q:_What_Code::Blocks_is_not.3F (https://wiki.codeblocks.org/index.php/FAQ-General#Q:_What_Code::Blocks_is_not.3F)
Quote
Q: What Code::Blocks is not?
A: Code::Blocks is not a compiler, nor a linker. Release packages of Code::Blocks may include a compiler suite (MinGW/GCC), if not provided by the target platform already. However, this is provided "as-is" and not developed/maintained by the Code::Blocks development team.

What you stated sounds more like a compiler feature than a Code::Blocks feature.

Tim S.
Title: Re: Disable Automatic Preprocessor Directives
Post by: purpleferns on January 19, 2024, 03:18:28 pm
That's fair, I'm just new to this so I'm not sure where each project begins and ends.
I'm using the GNU GCC Compiler, am I able to change it from the global compiler settings or should I ask in the GNU GCC forums (or wherever they talk about)
EDIT: Setting the "Treat as errors the warnings demanded by strict ISO C and ISO C++" flag under Global Compiler Settings -> Compiler Settings seems to do what I want it to do. If you're using the GNU GCC Compiler then this should work.