# Checking for compiler pragmas when building Debug

**URL:** <https://clarionhub.com/t/checking-for-compiler-pragmas-when-building-debug/6269>\
**Category:** questions\
**Tags:** debugging, compiler\
**Created:** [May 25, 2023, 1:02am UTC](https://clarionhub.com/t/checking-for-compiler-pragmas-when-building-debug/6269 "2023-05-25T01:02:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaulAttryde](https://clarionhub.com/user_avatar/clarionhub.com/paulattryde/32/3519_2.png) [@PaulAttryde](https://clarionhub.com/u/PaulAttryde)\
**Post date:** [May 25, 2023, 1:02am UTC](https://clarionhub.com/t/checking-for-compiler-pragmas-when-building-debug/6269/1 "2023-05-25T01:02:33Z")

</div>

So it's been at least a decade since I needed to care about compiler pragmas, can some gentle soul remind me how to tell if the project is set to compile in debug mode or not?  
I seem to remember using '#pragma debug' in the PRJ but I can't remember how to check in code whether it's set or not.  
And, not that this should matter, this is C6 🙂

---

<div class="post-metadata">

**Author:** ![anon77170705](https://clarionhub.com/letter_avatar_proxy/v4/letter/a/ecccb3/32.png) [@anon77170705](https://clarionhub.com/u/anon77170705)\
**Post date:** [May 25, 2023, 1:20am UTC](https://clarionhub.com/t/checking-for-compiler-pragmas-when-building-debug/6269/2 "2023-05-25T01:20:12Z")

</div>

The Project Manager sets the `define(_DEBUG_)` pragma to “on” and the `define(_RELEASE)` pragma to “off” if the project has to be compiled in debug mode. These 2 symbols can be used in sources, for example,

> OMIT(‘—’,\_RELEASE)  
> … text to be used in debug mode only …  
> ! —

Single lines which can be used in debug mode only can be marked by ? character in first column:

> ? MESSAGE (‘I run in debug mode’)

---

<div class="post-metadata">

**Author:** ![PaulAttryde](https://clarionhub.com/user_avatar/clarionhub.com/paulattryde/32/3519_2.png) [@PaulAttryde](https://clarionhub.com/u/PaulAttryde)\
**Post date:** [May 25, 2023, 11:05am UTC](https://clarionhub.com/t/checking-for-compiler-pragmas-when-building-debug/6269/3 "2023-05-25T11:05:03Z")

</div>

Perfect, thank you Alexey!

---

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [May 25, 2023, 2:04pm UTC](https://clarionhub.com/t/checking-for-compiler-pragmas-when-building-debug/6269/4 "2023-05-25T14:04:38Z")

</div>

There is the [Predefined Compiler Flags](https://clarion.help/doku.php?id=predefined_compiler_flags.htm) help topic. It does not mention `_RELEASE_`

 ![image](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/a/afd3f487f3f225056019f125dfbc0b1cbcc3af5a.png)

* * *

Help on OMIT and COMPILE show examples

 ![image](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/9/91b510d733b9870a7ce4caa834ca07f5e3923051.png)

* * *

The C8-C11 Editor has a Comment button on the Toolbar. The Drop list of that can wrap the Selected code in an OMIT or COMPILE, or can prefix the lines with “?” for Debug:

 ![image](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/2/2a64864f2828f2e5302edf54cd333f56ac8fca56.png)

Omit/Compile popup window asks for a Symbol. I typed `_Debug_`. Be nice if it had a drop list of common choices.

 ![image](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/9/9ed4e1a7e49b4d43c4efd0782a8bdbdbff5b7929.png)

Result:

 ![image](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/e/e1c822810b3633f66cfbc3915e1eb5a288b954fb.png)
