
printf/scanf format character(s) for 64 bit ints ??
Quote:
>: Make the 64 bit integer type "long" and you don't have to invent
>: anything.
> That wuld create porability problems, then everyone else that
Yes, if the code is not portable, this will certainly cause portability
problems :-)
Quote:
>wanted to use any of the source for that compiler would have to have
>a double long (in most cases) to accomodate for the 64 bits. The same
>thing can occure when going from UNIX to DOS, and int just isn't the
>same thing anymore, if you are lucky there will be the ocasional
>programmer that will take this into account and instead of just saying
>'int i', will say 'long int i', this dosen't mean much for the unix
>os but for the dos os it means a world of difference, just like going
>the other way 'short int i' can be a great deal of help (ie dos to unix).
>Though I'll grant you this the 16 bit int and 32 bit int (almost) are
>becoming a dieing breed they don't need to be totally ignored. I can't
>recommend a format specifier for the original poster since I don't run
>into the need for such a thing just take into consideration that C code
>goes between platforms all the time.
C code which is not _broken_ goes between platforms all the time
without any problems, no matter what the sizes of the integer types
are. The standard specifies the minimum number of bits for each integer
type. If a program relies on a greater number of bits than the one
guaranteed, that program is non-portable and it can be considered
broken from the portability point of vue.
The idea to design compilers in such a way that non-portable code can
be ported doesn't make much sense for me. If a program is broken, you
don't fix the compiler, although the reverse happens from time to time
:-)
Dan
--
Dan Pop
CERN, CN Division
Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland