Hello, are there any restrictions of codesize within a codeblock?
For examle the first code doesn't work:
if ( value ){ . . many Codelines . }
If i shorten the code above, then it works. i couldn't find out the border to the codesize within the block.
But this Code works correct:
if ( value ){ myfunction(); } void myfunction (void){ . . many Codelines . }
In both cases i don't get any error-messages from the compiler, while compiling.
Thanks for help Christian Tauschek
... what is a codeblock? I am not familiar with that name
Erik
A draft of the C99 manual is widely available as a pdf on the internet.
Refer to section 6.8 paragraph 3 for a full explanation.
are there any restrictions of codesize within a codeblock?
The limitations of the compiler are given in the manual (always a good source to refer to in case of problems):
http://www.keil.com/support/man/docs/c51/c51_xd.htm
There is no mention of a block length limit, but other limits (e.g. nesting depth) exist.
Now that i know what it is
Hello,
if ( value ) { . . // i described this area as "codeblock" . }
I've no idea how you could manage without them. Are you really sure you read and understood that paragraph?
Do you mean, for example, this: www.open-std.org/.../n1124.pdf - which is "WG14/N1124 Committee Draft - May 6, 2005 ISO/IEC 9899:TC2" ?
"Refer to section 6.8 paragraph 3 for a full explanation."
That paragraph refers to a "block" - not a "codeblock".
Like Erik, I have not heard the term "codeblock" used in this context before.
http://wiki.codeblocks.org
Yes, that's the one.
A block allows a set of declarations and statements to be grouped into one syntactic unit.
While I certainly agree that the term 'codeblock' is not used, I was allowing for the reader's ability to manage the conceptual leap:
"Set of declarations and statements": code.
"Set of declarations and statements grouped into one syntactic unit": codeblock, as in 'block of code'.
I should know better.
Yes, I made that "leap" - but you can never be sure that the OP was making the same leap, or if he actually had some specific meaning for his compound word "codeblock"
As has already been noted, it is also a product name...
"As has already been noted, it is also a product name..."
Or at least "almost" a product name. "Code::Blocks" http://www.codeblocks.org/
One of the nicest open IDE available for Windows. Great support for a lot of compilers.
The code doesn't work the way you expect it to? That's nothing new. Before blaming the compiler, you should search for bugs in your code. Timing-related bugs, interaction with interrupts (shared resources), even the simplest things like an unserviced watchdog timer can crash a program.
"The code doesn't work the way you expect it to? That's nothing new. Before blaming the compiler, you should search for bugs in your code. Timing-related bugs, interaction with interrupts (shared resources), even the simplest things like an unserviced watchdog timer can crash a program."
I don't think the OP was saying that his code wasn't working. Rather that the compiler reported an error with these larger blocks.
As a matter of fact, no. The OP said that the code didn't work. And that's about all he decided to share with us as far as a description of the problem is concerned.
No, the OP did imply a problem with the compiler, and not when running the code.
He described two work-arounds, and noted that: "In both cases i don't get any error-messages from the compiler, while compiling."