User forums > Embedded development

Taking into account C99 standard

(1/7) > >>

Pavel_47:
Hello,

While trying to use the following construction:

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

I get the folllowing message:

udp_server_v0.c 54 error: 'for' loop initial declarations are only allowed in C99 mode
udp_server_v0.c 54 note: use option -std=c99 or -std=gnu99 to compile your code

I searched for these options in Settings-->Compiler-->Compiler Settings-->Global Compiler Settings-->Compiler Flags, but didn't find them.
Then I've tried to add them into Settings-->Compiler-->Compiler Settings-->Global Compiler Settings-->Other Options.

No any effect !

Thanks in advance.

Pavel.

Quiss:
Those will affect on new projects. For your current project, right click project name on the left pane(under Manager->Projects tab) and select Build Options.

stahta01:

--- Quote from: Quiss on October 14, 2014, 02:59:35 pm ---Those will affect on new projects. For your current project, right click project name on the left pane(under Manager->Projects tab) and select Build Options.

--- End quote ---

The above is NOT true in most if not all cases.

He is likely changing the wrong global compiler.
He needs to verify the project is using the same CB Compiler as the one he changed.

EDIT: As found out later in this thread or another thread he is using a Custom makefile without any understanding of what it means in CB.

Tim S.

Quiss:
I've just tried this and yes, you're right stahta01. Some years before, I don't remember exactly, I had that kind of problem but obviously it was from something else. Sorry for misinformation.

Pavel_47:
Hello stahta01,

I put option -std=c99 into Prebuild Steps (if I properly understood your suggestion)

Here is compilation output:
Running target pre-build steps
-std=c99
Execution of '-std=c99' in 'C:\Users\Pavel\Documents\Proj_EPFL\contiki-2.7\LoWPAN_EPFL\link_v1' failed.

Navigation

[0] Message Index

[#] Next page

Go to full version