Mail Archives: djgpp/1997/08/14/18:54:13
Chris Croughton wrote:
>
> Erik Max Francis wrote:
>
> >As the chief ANSI C advocate on this newsgroup, I should point out that
> >ANSI does not say anything about the size of the fundamental integer types
> >(short, int, long), except that short is no larger than int and int is no
> >larger than long, and short is at least 16 bits and long is at least 32.
> >(What's interesting is that these latter two requirements are hidden
> >rather well in the standard.)
>
> I have used one compiler (VAX, possibly?) which had short = int = long
> and
> all 32 bit. Fortunately, char was still 8 bit (but it needn't be - some
> machines have 9 bit chars).
9 bit chars!? Weird. So they used a 16-bit word and ignored 7 bits?
> The only portable way is to do it yourself - either by breaking longer
> variables up into chars or in ASCII. Especially since you can't rely
> on any byte ordering scheme (I gather there are some machines where a
> long is held in memory as bytes 2, 1, 4 and 3 or something similar, not
> even a reversible format).
Well, I know Intel's load, say, 1234h into memory as 3412... atleast I
think that's it. And 12345678h would be 78563412... not totally sure
though.
> Isn't this all in the FAQ? Or was it one of the other C newsgroup FAQs?
Don't think it would be in the DJGPP faq. Unless you're refering to
int's being 32-bit... yeah, I think that's in the faq.
Jeff
--------------------------------------------
- Code X Software -
Programming to a Higher Power
email: mailto:pweeks AT execulink DOT com
web: http://www.execulink.com/~pweeks/
--------------------------------------------
- Raw text -