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 241,366 of 243,242   
   Janis Papanagnou to Scott Lurndal   
   Re: signed vs unsigned and gcc -Wsign-co   
   21 Oct 25 04:27:11   
   
   From: janis_papanagnou+ng@hotmail.com   
      
   On 20.10.2025 20:01, Scott Lurndal wrote:   
   > Michael S  writes:   
   >> [...]   
   >   
   > One might also point out that negative loop indicies are rare, and   
   > thus ones conclusion may be that generally speaking loop indexes should   
   > be unsigned.   
      
   Just note that loop-indices typically run over arrays. And while okay   
   in an (more common) ascending traversal it may become error-prone in a   
   descending array-traversal loop.  uint i; for (i=N-1; i>=0; i--) a[i];   
      
   Janis   
      
   --- 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