From: tnp@invalid.invalid   
      
   On 29/08/2024 09:32, Richard Kettlewell wrote:   
   > druck writes:   
   >> You can do this on Windows too, but they had to bastardise their C   
   >> 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:-   
   >   
   > (Almost everyone; Cray had 64-bit int.)   
   >   
   >> int=32 bits, long=64 bits, long long=64 bits   
   >   
   > THe 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.   
   >   
   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 basis   
      
   --   
   Climate Change: Socialism wearing a lab coat.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|