home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 242,969 of 243,242   
   Michael S to Keith Thompson   
   Re: printf and time_t   
   12 Jan 26 10:50:10   
   
   From: already5chosen@yahoo.com   
      
   On Sun, 11 Jan 2026 15:23:35 -0800   
   Keith Thompson  wrote:   
      
   > Michael S  writes:   
   > >   
   > > To be fair, it is not ideal.   
   > > The solution that I would prefer would be universal adaption of   
   > > Microsoft's size specifiers I32 and I64. They are not going to win   
   > > beauty competition, but in practice they are a lot more convenient   
   > > to use than standard macros and are equally good at carrying   
   > > programmer's intentions.   
   >   
   > The relative beauty of a feature that isn't available hardly seems   
   > relevant.   
   >   
   > The ideal solution is to write correct, and preferably portable,   
   > code in the first place.  There are often good reasons to write   
   > non-portable code, but I suggest that fiding the correct format   
   > string to be ugly is not one of them.   
   >   
   > (Microsoft's documentation says that "I32" prefix applies to an   
   > argument of type __int32 or unsigned __int32.  I don't know whether   
   > __int32 is compatible with int, with long, or neither, and I don't   
   > much care.  I don't know what Microsoft guarantees about printf   
   > with incompatible types that happen to have the same size.)   
   >   
      
   Microsoft guarantees that __int32 is compatible with int32_t and that   
   'unsigned __int32' is compatible with uint32_t. The same goes for 64-bit   
   types.   
   That's sufficient for safe use of format specifier "%I32u" when   
   printing uint32_t variables.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca