Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » eTrice » generating code for Keil compiler(error: #268: declaration may not appear after executable statement in block)
generating code for Keil compiler [message #1008588] Wed, 13 February 2013 08:31 Go to next message
Stefan St is currently offline Stefan StFriend
Messages: 5
Registered: February 2013
Junior Member
Hello,

I'm pretty new to eTrice and I just want to find out, if eTrice code-generation would fit in our developement process which uses the Keil toolchain.

Now I've tried the HelloWorld example from eTrice documentation homepage. I set up a Keil project to compile the generated code, so far. Unfortunately, Keil seems to have its own rules, that declaration should be at the beginning of a block, while eTrice generation just puts it, where it first appears. So, when compiling, I get a message:

error: #268: declaration may not appear after executable statement in block

Is there a possibility, to make the generator put declarations at the beginning of a block?

thx,
Stefan Confused
Re: generating code for Keil compiler [message #1008648 is a reply to message #1008588] Wed, 13 February 2013 12:15 Go to previous message
Henrik Rentz-Reichert is currently offline Henrik Rentz-ReichertFriend
Messages: 261
Registered: July 2009
Senior Member
Hi Stefan,

we have been aware of this problem.
A strictly ANSI-C compliant compiler requires that variable declarations only occur at the beginning of a block.
But it shouldn't be much work to get that fixed.

Could you please file a bug for this?

Thanks,
Henrik

Am 13.02.2013 12:27, schrieb Stefan St:
> Hello,
>
> I'm pretty new to eTrice and I just want to find out, if eTrice code-generation would fit in our developement process which uses
> the Keil toolchain.
> Now I've tried the HelloWorld example from eTrice documentation homepage. I set up a Keil project to compile the generated code,
> so far. Unfortunately, Keil seems to have its own rules, that declaration should be at the beginning of a block, while eTrice
> generation just puts it, where it first appears. So, when compiling, I get a message:
>
> error: #268: declaration may not appear after executable statement in block
>
> Is there a possibility, to make the generator put declarations at the beginning of a block?
>
> thx,
> Stefan :?
Previous Topic:self transitions
Next Topic:TimingService generation
Goto Forum:
  


Current Time: Sun Dec 08 13:01:25 GMT 2024

Powered by FUDForum. Page generated in 0.02723 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top