|
for loop special case broken
#417064
02/07/13 23:46
02/07/13 23:46
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
OP
Expert
|
OP
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Hello Mr. Lotter, there is an issue with the following snippet.
#include <acknex.h>
void main()
{
for (; ; wait(1));
}
the compiler does not reject it (that's correct, it's valid c code) but as soon as the engine starts it gets stuck in an endless loop. The actual engine window never pops up, just the white starter window.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: for loop special case broken
[Re: Uhrwerk]
#417096
02/08/13 12:11
02/08/13 12:11
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
Valid code is Valid code. The compiler checks for valid code, not functionality. the above is like:
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
Re: for loop special case broken
[Re: jcl]
#417106
02/08/13 13:33
02/08/13 13:33
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
OP
Expert
|
OP
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
It's not easier. It's easier for you. For everybody else it is much more complicated.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: for loop special case broken
[Re: jcl]
#417112
02/08/13 14:30
02/08/13 14:30
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
OP
Expert
|
OP
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
No, this is not about me. I know this bug now. I'll never do it again and even if I did I'd immediately know what's wrong with my code. This is for example about MasterQ32: I ran into this problem some time ago that the for-loop doesn't work like expected if you use wait. I also don't think this the usage of a for loop is bizarre. While the sample I originally posted is clearly pointless there actually are applications where this kind of a for loop is very elegant:
for (my-frame = 0; ; wait(1))
my->frame += time_step;
You're a very experienced software engineer, probably much more experienced than me. But I still don't think that you're doing yourself or anybody else a favor when mentioning bugs in the manual instead of fixing them. I think your users do not prefer new features over correct software. If the new WED gets delayed one working day because of this bug being fixed most users will gladly accept this. Once again: Your software, your decision. I hold you in high regard for caring about this great piece of software for such a long time. It's just that I simply don't get your point here.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
|