<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Create own Warning / Error Message in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202208#M5528</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At compilation time it's IMPOSSIBLE to know the values of the variables, because they change at runtime, that's why everything I suggest was at runtime.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once I define a MACRO for every bitposition and then test it at compilation time, maybe it helps. I'll explain what I did:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lets assume you have and 8bit register where every bitposition is a flag. It could be described as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;msb &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lsb&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; | F7 | F6&lt;SPAN&gt;&amp;nbsp;| F5&lt;SPAN&gt;&amp;nbsp;| F4&lt;SPAN&gt;&amp;nbsp;| F3&lt;SPAN&gt;&amp;nbsp;| F2&lt;SPAN&gt;&amp;nbsp;| F1&lt;SPAN&gt;&amp;nbsp;| F0 |&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;Then you have a variable wich uses this structure (in your case it will be &lt;STRONG&gt;var1&lt;/STRONG&gt;) , then when initializing var1 you do something like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;var1.F7 = 1;var1.F4 = 1;var1.F3 = 1;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;Now, what you can do is add some macro definitions, for every falg initialization, where the value of the macro is the mask for the corresponding flag:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;// Every bit-mask definition for var1#define MACRO_var1_F7   0x80#define MACRO_var1_F6   0x40#define MACRO_var1_F5   0x20#define MACRO_var1_F4   0x10#define MACRO_var1_F3   0x08#define MACRO_var1_F2   0x04#define MACRO_var1_F1   0x02#define MACRO_var1_F0   0x01// Value of macro corresponding with initialization values#define MACRO_var1      (MACRO_var1_F7 + MACRO_var1_F4 + MACRO_var1_F3)   // Wrong initilization#define MACRO_var1_WRONG   (MACRO_var1_F7 + MACRO_var1_F4 + MACRO_var1_F3 + MACRO_var1_F0)   var1 = MACRO_var1;    // Replace everybit initialization with macro value#if (MACRO_var1 == MACRO_var1_WRONG)   #error "Wrong var1 initialization"#endif&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know if I made myself clear, but that's the closer you can get if you want to detect and init error at compilation time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Feb 2012 21:57:30 GMT</pubDate>
    <dc:creator>sebasira</dc:creator>
    <dc:date>2012-02-02T21:57:30Z</dc:date>
    <item>
      <title>Create own Warning / Error Message</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202200#M5520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can i create my own warning or error message, which is used by the compiler?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i want to do is to show an warning at compilation time f.e. when 2 Variables have certain values. Code should look like this:&lt;/P&gt;&lt;PRE&gt;if(var1 == var2)&amp;nbsp; {&amp;nbsp; #WARNING "attention, var1 and var2 have the same value"&amp;nbsp; }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 17:26:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202200#M5520</guid>
      <dc:creator>Seppel</dc:creator>
      <dc:date>2012-02-01T17:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Create own Warning / Error Message</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202201#M5521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Which CPU are you targeting (HC08, HC12, Coldfire, ..)&lt;BR /&gt;- Which version of CodeWarrior are you using?&lt;/P&gt;&lt;P&gt;#warning is not a ANSI C standard pre-processor macro. So answer here depends on the compiler you are using.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 18:06:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202201#M5521</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2012-02-01T18:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create own Warning / Error Message</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202202#M5522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Seppel!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As CrasyCat says, it depends on what compiler your using.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it helps, I'm using CW 3.1 and CW 4.6, both for HCS12... Here's what I do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#error "ERROR TEXT HERE"or#warning "WARNING TEXT HERE"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe the problem is that you write it in UPPERCASE, try lowercase&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 22:08:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202202#M5522</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2012-02-01T22:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create own Warning / Error Message</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202203#M5523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your replies Sebasira and CrasyCat!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using a HCS08 Controller and Codewarrior 5.9.0. My Compiler accepts the suggestions from sebasira, so #error and #warning works. But i can't combine it with an IF ...THEN logic, how can i do this? The warning should only be showed, when an IF-condition is true. Therefor i have put in the #warning like in my first post. But this is warning always be shown, it don't cares of the IF condition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 14:48:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202203#M5523</guid>
      <dc:creator>Seppel</dc:creator>
      <dc:date>2012-02-02T14:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create own Warning / Error Message</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202204#M5524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What are you trying to achieve here exactly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#warning and #error generate preprocessor warnings or error messages. That means these messages are generated at compilation time.&lt;/P&gt;&lt;P&gt;You can have conditional error or warning messages generated if you enclose them into conditional preprocessing blocks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;P&gt;&amp;nbsp; #if&amp;nbsp;&amp;nbsp; (MY_MACRO == 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #warning "Incorrect definition of&amp;nbsp;&amp;nbsp;MY_MACRO."&lt;/P&gt;&lt;P&gt;&amp;nbsp; #endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The #warning or #error preprocessor commands cannot be used to generate warning or error messages at runtime.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 15:37:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202204#M5524</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2012-02-02T15:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Create own Warning / Error Message</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202205#M5525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to implement a way to protect some vars from getting wrong init values.&lt;/P&gt;&lt;P&gt;F.e. i have some vars which are flags (bitpositions have the info), andthere are lots of possible flag state combinations. But there are few special flag state combinations, which are not allowed!&lt;/P&gt;&lt;P&gt;By developing the code i often switch between different flag-state-combinations and i want to protect myself to compile code with wrong flag-states.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cannot test my Var with #if instruction like this:&lt;/P&gt;&lt;PRE&gt;#if(var1 == var2)    {    #error "Invalid Var State: var1 == var2"    }  #endif&lt;/PRE&gt;&lt;P&gt;Because #if expects a Macro-parameter. I try to generate a Macro like this&lt;/P&gt;&lt;PRE&gt;#define VAR_MACRO var1==var2&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this ends with "Warning C4443 Undefined Macro 'var1'"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 17:57:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202205#M5525</guid>
      <dc:creator>Seppel</dc:creator>
      <dc:date>2012-02-02T17:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create own Warning / Error Message</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202206#M5526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I don't understand wrong what you're trying to do is not possible, because values of &lt;STRONG&gt;var1&lt;/STRONG&gt; and &lt;STRONG&gt;var2&lt;/STRONG&gt; change at runtime. So the compiler won't know (at compilation time) if the value of var1 equals vars2. just like CrasyCat stated:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;gt;The #warning or #error preprocessor commands cannot be used to generate warning or error messages at runtime&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is up to you (the programmer) to ensure that var1 won't equal var2. What you can do is put some "alarm" or something like that to notify that the not-allowed-condition took place. You can blink a LED, sound a buffer, send data trhough a port or display a message on screen. And that can help you debug your program and correct any wrong initialization.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 20:27:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202206#M5526</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2012-02-02T20:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create own Warning / Error Message</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202207#M5527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&amp;gt;You can blink a LED, sound a buffer, send data trhough a port or display a message on screen.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;But these are all things that work at runtime. I don't want to recognize at runtime, but at compile time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I init these vars as global vars in the top of the *.c-file and after these inits i want the compiler to check if the vars have wrong values.... isn't that possible?!?&lt;/P&gt;&lt;P&gt;I mean, the compiler f.e. also recognize if i want put a 32bit value in a 8bit unsigned char var, and show me a warning or error for trying that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 21:09:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202207#M5527</guid>
      <dc:creator>Seppel</dc:creator>
      <dc:date>2012-02-02T21:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Create own Warning / Error Message</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202208#M5528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At compilation time it's IMPOSSIBLE to know the values of the variables, because they change at runtime, that's why everything I suggest was at runtime.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once I define a MACRO for every bitposition and then test it at compilation time, maybe it helps. I'll explain what I did:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lets assume you have and 8bit register where every bitposition is a flag. It could be described as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;msb &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lsb&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; | F7 | F6&lt;SPAN&gt;&amp;nbsp;| F5&lt;SPAN&gt;&amp;nbsp;| F4&lt;SPAN&gt;&amp;nbsp;| F3&lt;SPAN&gt;&amp;nbsp;| F2&lt;SPAN&gt;&amp;nbsp;| F1&lt;SPAN&gt;&amp;nbsp;| F0 |&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;Then you have a variable wich uses this structure (in your case it will be &lt;STRONG&gt;var1&lt;/STRONG&gt;) , then when initializing var1 you do something like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;var1.F7 = 1;var1.F4 = 1;var1.F3 = 1;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;Now, what you can do is add some macro definitions, for every falg initialization, where the value of the macro is the mask for the corresponding flag:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;// Every bit-mask definition for var1#define MACRO_var1_F7   0x80#define MACRO_var1_F6   0x40#define MACRO_var1_F5   0x20#define MACRO_var1_F4   0x10#define MACRO_var1_F3   0x08#define MACRO_var1_F2   0x04#define MACRO_var1_F1   0x02#define MACRO_var1_F0   0x01// Value of macro corresponding with initialization values#define MACRO_var1      (MACRO_var1_F7 + MACRO_var1_F4 + MACRO_var1_F3)   // Wrong initilization#define MACRO_var1_WRONG   (MACRO_var1_F7 + MACRO_var1_F4 + MACRO_var1_F3 + MACRO_var1_F0)   var1 = MACRO_var1;    // Replace everybit initialization with macro value#if (MACRO_var1 == MACRO_var1_WRONG)   #error "Wrong var1 initialization"#endif&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know if I made myself clear, but that's the closer you can get if you want to detect and init error at compilation time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 21:57:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202208#M5528</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2012-02-02T21:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create own Warning / Error Message</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202209#M5529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since the preprocessing occurs prior to any&amp;nbsp;compilation, in order to make use of&amp;nbsp;the preprocessor error and warning commands would require that the initialisation constants for the static variables in question, be defined as preprocessor macros.&amp;nbsp; The macro values could then be compared by the preprocessor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;#define&amp;nbsp; VAR1_val&amp;nbsp;&amp;nbsp;&amp;lt;expression&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;#define&amp;nbsp; VAR2_val&amp;nbsp;&amp;nbsp;&amp;lt;expression&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;#if&amp;nbsp; VAR1_val==VAR2_val&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;#error "&amp;lt;string&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;#endif&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;int var1 = VAR1_val;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;int var2 = VAR2_val;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 22:13:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202209#M5529</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2012-02-02T22:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create own Warning / Error Message</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202210#M5530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First thanks again for your detailed help sebasira and bigmac!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't know / recognize that #warning etc are preprocessor instructions, which are used before compilation-time, so now i understand why i can't check my vars like that &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;I will take the solution that bigmac offers...really smart by the way:&lt;/P&gt;&lt;P&gt;1) put my flag values in MACROs&lt;/P&gt;&lt;P&gt;2) compare the MACROs&lt;/P&gt;&lt;P&gt;3) init vars with MACRO values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 22:30:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Create-own-Warning-Error-Message/m-p/202210#M5530</guid>
      <dc:creator>Seppel</dc:creator>
      <dc:date>2012-02-02T22:30:55Z</dc:date>
    </item>
  </channel>
</rss>

