Re: Signed only index?
- From: jaysome <jaysome@xxxxxxxxxxx>
- Date: Fri, 11 Jan 2008 23:20:26 -0800
On Fri, 11 Jan 2008 13:55:40 -0800, Ben Pfaff <blp@xxxxxxxxxxxxxxx>
wrote:
"Malcolm McLean" <regniztar@xxxxxxxxxxxxxx> writes:
"Walter Roberson" <roberson@xxxxxxxxxxxxxxxxxx> wrote in message
Malcolm McLean <regniztar@xxxxxxxxxxxxxx> wrote:Yes. Vijay is posting to Usenet, which implies that he is using a
Almost certainly the bytes at the location immediately before the
array "a"
will be 0x00000001.
Did I miss some evidence that on Vijay's machine,
int is 32 bits rather than (say) 16 ?
fairly modern desktop computer.
I've seen a surprising number of posters here who appear to be
using antique compilers for DOS, such as Turbo C 2.0, which had
16-bit int.
The C Standard places no restrictions on any relationship between the
host platform and the target platform. Embedded programmers are
thankful for this.
There is no reason whatsoever to assume that because someone posts a
message to Usenet from one platform that they are using a compiler
that targets that same platform. They could well be targeting another
platform, i.e., cross-compiling.
One of numerous examples is the TI Code Composer compiler (see [1] for
another example), which runs on Windows XP and Windows Vista, and
supports cross compilation for the C5501 DSP, which defines the
following:
CHAR_BIT = 16
sizeof(char) = 1 /* by definition in C */
sizeof(short) = 1
sizeof(int) = 1
sizeof(long) = 2
It should be noted that the C5501 is Big Endian.
And, thankfully, all of this is acceptable as far as the C Standard is
concerned.
Regards
--
jay
[1] The Microchip C30 compiler, for some targets, defines the
following:
CHAR_BIT = 8
sizeof(char) = 1 /* by definition in C */
sizeof(short) = 2
sizeof(int) = 2
sizeof(long) = 4
.
- References:
- Signed only index?
- From: Vijay Kumar R. Zanvar
- Re: Signed only index?
- From: Malcolm McLean
- Re: Signed only index?
- From: Walter Roberson
- Re: Signed only index?
- From: Malcolm McLean
- Re: Signed only index?
- From: Ben Pfaff
- Signed only index?
- Prev by Date: Re: Problems reserving memory with the 'malloc' command
- Next by Date: Re: Recovering from out of memory on the stack
- Previous by thread: Re: Signed only index?
- Next by thread: Re: Signed only index?
- Index(es):
Relevant Pages
|
|