Author Topic: Disable Automatic Preprocessor Directives  (Read 2174 times)

Offline purpleferns

  • Single posting newcomer
  • *
  • Posts: 6
Disable Automatic Preprocessor Directives
« 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?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7666
    • My Best Post
Re: Disable Automatic Preprocessor Directives
« Reply #1 on: January 18, 2024, 07:52:33 pm »
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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline purpleferns

  • Single posting newcomer
  • *
  • Posts: 6
Re: Disable Automatic Preprocessor Directives
« Reply #2 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.
« Last Edit: January 19, 2024, 03:23:42 pm by purpleferns »