How to enable gnu11 / c11 compiler settings in PSoC Creator 4.4

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
PascalS
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

Hello,

I would like to define variables inside a for loop like this:

 

if(int i = 0;i<10;i++){
    //FOO    
}

 

Therefore I tried to add Command Line Custom Flags like "-std=gnu11" / "-std=c11":

1.png

 

2.png

 

3.png

 

4.png

 

But it brings me the following error:

error.png

"Expected expression before int" 

BR

0 Likes
1 Solution
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @PascalS ,

Can you please make sure that the syntax you are using is correct?
You have used "if" instead of "for" which is why you are facing this error.
Can you please make this correction and try the build operation again?

Warm Regards
Alen

View solution in original post

2 Replies
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @PascalS ,

Can you please make sure that the syntax you are using is correct?
You have used "if" instead of "for" which is why you are facing this error.
Can you please make this correction and try the build operation again?

Warm Regards
Alen

AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @PascalS ,

Glad your query is resolved.
Please feel free to post any queries or issues you may have on Infineon products in the community and we will be happy to help.

Thanks and Regards,
Alen 

0 Likes