C/C++ Control Structure Limitations? -
I have a nested if statement (somewhere in the ballpark of 300). The code was of the form:
< P> I was surprised by the fact that is is such a limit, and this limit is so small that I am not looking for comments about coding practice and with such things Why not completely avoid it. if (a) ... else if (b) ... else if (c) ... ...
Here is a list of things that I can imagine may have some limitations: <
There are such limitations in other control structures / language features? Did the language standards say anything about these limits (possibly the minimum requirements for an implementation)? Is this arrangement done with any particular compiler / implementation in the bounds of a particular language?
Edit: Please note that the description of if
is actually "nested." It is equivalent to:
if (a) {// ...} else {if (b) {// ...} else {if (c) {// .. } Else {// ...}}}
C ++ standard recommends limitations for different language creation. The following is a list of constructions where the visual C ++ compiler does not apply the recommended limit. The first number is the recommended limit and the second number is the limit implemented by C ++:
Nesting level of mixed statements, walking control structures, and selection control structures [256] (256) ).
Parameters in a macro definition [256] (127).
Logic in a macro inoculation [256] (127).
Characters or literal strings in a character string (after concatenation) [65536] (65535)
User Starters [/ S]
In the Constructor Definition a constructive definition In member initiators [6144] (about 600, depending on the memory, / Zm can be compiled by the compiler option).
Ability to Identify an Identifier [256] (127).
Nested external specifications [1024] (10).
Template argument in a template declaratio n [1024] (64).
Comments
Post a Comment