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,839 of 243,242   
   Michael S to James Kuyper   
   Re: printf and time_t   
   06 Jan 26 20:05:22   
   
   From: already5chosen@yahoo.com   
      
   On Tue, 6 Jan 2026 10:31:41 -0500   
   James Kuyper  wrote:   
      
   > On 2026-01-06 04:29, Michael S wrote:   
   > > On Tue, 6 Jan 2026 00:27:04 -0000 (UTC)   
   > > Lawrence D’Oliveiro  wrote:     
   > ...   
   > >> Section 7.8 of the C spec defines macros you can use so you don’t   
   > >> have to hard-code assumptions about the lengths of integers in   
   > >> printf-format strings.     
   > >    
   > > Did you ever try to use them? They look ugly.     
   >    
   > Which is more important, correctness or beauty?   
   >    
      
   It depends.   
      
   When I know for sure that incorrectness has no consequences, like   
   in case of using %u to print 'unsigned long' on target with 32-bit   
   longs, or like using %llu to print 'unsigned long' on  target with   
   64-bit longs, then beauty wins. Easily.   
      
   > If you know that an expression has one of the standard-named types or   
   > typedefs for with there is a corresponding printf() specifier, you   
   > should use that specifier. Otherwise, if you know that an expression   
   > has one of the types declared in , you should use the   
   > corresponding macro #defined in  to print it.   
      
   I should? Really?   
   Sorry, James, but you have no authority to make such statements.   
      
   Unless you meant colloquial 'you' rather than a person participating on   
   Usenet under nick Michael_S.   
      
   > If you have   
   > a value that is not known to be of one of those types, but is known   
   > to be convertible to one of those types without change of value, you   
   > should convert it to one of those types.   
      
   That is better advice.   
      
   --- 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