Re: 8051 and a C switch statement
- From: Stefan Reuther <stefan.news@xxxxxxxx>
- Date: Sat, 29 Dec 2007 19:00:34 +0100
robertwessel2@xxxxxxxxx wrote:
On Dec 28, 4:39 pm, Martin Griffith <mart_in_medina@xxxxxxxx> wrote:
" how big can I make the switch statement?"
Whats the limit?
I'm using the rasionance C compiler.
The C standard (C89/90) requires that the implementation support at
least 257 labels in a switch statement.
These limits aren't worth anything. A compiler is required to compile at
least one program containing 257 case labels. This one and only program
might look like this:
int main() {
switch (0) {
case 1: case 2: ...... case 257: default: break;
}
return 0;
}
and the compiler is still conformant. Some others (like an object size
of 32767) cannot be fulfilled at all by some architectures.
Stefan
.
- References:
- 8051 and a C switch statement
- From: Martin Griffith
- Re: 8051 and a C switch statement
- From: robertwessel2@xxxxxxxxx
- 8051 and a C switch statement
- Prev by Date: Re: ~~~~~~~~~ Hot Women ~~~~~~~`
- Next by Date: Re: BIN-LADEN IS KILLED! (PHOTO)
- Previous by thread: Re: 8051 and a C switch statement
- Next by thread: Re: 8051 and a C switch statement
- Index(es):
Relevant Pages
|