Liste des Groupes | Revenir à cs raspberry-pi |
druck <news@druck.org.uk> writes:Most code that cares seems to use things like int_32 or long_64 where it matters and macro expand that on a per target hardware basisYou can do this on Windows too, but they had to bastardise their C(Almost everyone; Cray had 64-bit int.)
compiler for people that hadn't. It's the only one that on a 64 bit
platform that has long as 32 bits.
>
Windows:-
>
int=32 bits, long=32 bits, long long=64 bits
>
Everyone else in the bloody world:-
int=32 bits, long=64 bits, long long=64 bitsTHe Windows approach is well within what the C language spec allows, and
simplified the adaptation of existing Windows application code to 64-bit
platforms. The equivalent exercise in Linux needed attention to anything
that made (sometimes invisible) assumptions about the definition of
long.
I don’t think I’d fault either decision though the fact that we’ve ended
up with two conventions does make writing/maintaining portable code a
bit more annoying, though not really any more so than the slightly
different set of things compilers warn about or the lack of GCC
compatibility from MSVC. I think MS should bow the inevitable and
replace cl with Clang.
Les messages affichés proviennent d'usenet.