Re: C Interpreter and sizeof operator
- From: Christian Bau <christian.bau@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 30 Nov 2005 00:29:51 +0000
In article <438ce9a7$0$11070$e4fe514c@xxxxxxxxxxxxxx>,
Skarmander <invalid@xxxxxxxxxxxxxx> wrote:
> You can try and fudge this in cases where the application cannot possibly
> trip over the wrong size, but it's tricky to do this without violating the
> standard, and in an interpreter it's very unlikely to be of any value. Just
> pick a constant size for integers (4 bytes happens to be a very common one).
So if I write
long long i;
char array [100];
for (i = 0; i < 100; ++i) array [i] = i;
the compiler is free to use 1, 2, 3, 4 or any other number of bytes for
i, because it doesn't make any difference to the code. The compiler is
allowed to cheat, as long as you cannot detect that it cheats.
.
- Follow-Ups:
- Re: C Interpreter and sizeof operator
- From: Skarmander
- Re: C Interpreter and sizeof operator
- References:
- C Interpreter and sizeof operator
- From: ozbear
- Re: C Interpreter and sizeof operator
- From: Skarmander
- C Interpreter and sizeof operator
- Prev by Date: Re: C Interpreter and sizeof operator
- Next by Date: Help wanted on some source codes
- Previous by thread: Re: C Interpreter and sizeof operator
- Next by thread: Re: C Interpreter and sizeof operator
- Index(es):
Relevant Pages
|