McuXpresso Preprocessor ignored

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

McuXpresso Preprocessor ignored

Jump to solution
4,740 Views
SimoneColomboWEG
Contributor III

Hi,

im using mcuxpresso version 24.12 [Build 148] [2025-01-10], i'm usually use a preprocessor for global define but with a wrong behaviur of code i've checked that a preprocessor define is ignored by compiler and not by intellisense.

i've attached a immagine that show PROTOCOL_ACTIVATED on preprocessor , correctly the code is masked from intellisense but compile (i've generated an error).

#ifndef PROTOCOL_ACTIVATED

static bool err;

uint16_t sumT = 0;

uint16_t sumR = 0

for( int i = 0; i < TRANSFER_SIZE; i++ )

{

sumT += masterTxData[i];

sumR += masterRxData[i];

}

 

if( sumT != sumR )

{

if( err == false )

{

PRINTF( "SPI Data err\r\n" );

err = true;

}

}

else

{

err = false;

}

#else

static uint16_t Error;

Error = CNT_Spi_Handler(pCNT_SPI_RX_Data); //&masterRxData[0]

// To Be Done Gestione Errori! //

#endif

 

where is the problem?!

Simone

0 Kudos
Reply
1 Solution
4,559 Views
SimoneColomboWEG
Contributor III

Goodmorning EdwinHz i was going to exportating the code then open a case on yoyur link but now i just saw that preprocessor is not ingnore anymore, i don't know because today works! anyway thanks for your support, i close my issue without understand where the issue was.  thanks again!

Simoone

View solution in original post

0 Kudos
Reply
4 Replies
4,560 Views
SimoneColomboWEG
Contributor III

Goodmorning EdwinHz i was going to exportating the code then open a case on yoyur link but now i just saw that preprocessor is not ingnore anymore, i don't know because today works! anyway thanks for your support, i close my issue without understand where the issue was.  thanks again!

Simoone

0 Kudos
Reply
4,692 Views
SimoneColomboWEG
Contributor III

Thanks for replied, i can't build in release, i don't use a different profile. i think is a problem that comes from a particular configuration from by project, is more of curiosity instead a real problem. i can work with a general define on code. if you want i can share with you my code (privatelly if is possible) if you can help me to find the issue.

Simone

0 Kudos
Reply
4,686 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @SimoneColomboWEG,

Of course. You can share your code privately via a ticket on the following link: https://support.nxp.com/s/?language=en_US

Simply tag my name on the ticket's description and I will continue supporting you via that medium.

BR,
Edwin.

0 Kudos
Reply
4,717 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @SimoneColomboWEG,

That's interesting. On my tests, when the conditional code is not true, the error messages of the controlled text do not matter (i.e. the compiler ignores the syntax errors, opposite to what happens on your side):

2025-02-07_11-55-56.png

Does this happen in both Debug and Release build configurations for you?

BR,
Edwin.

 

0 Kudos
Reply