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,486 of 243,242   
   Thiago Adams to All   
   Re: type of decimal constants in msvc   
   19 Dec 25 08:43:54   
   
   From: thiago.adams@gmail.com   
      
   Em 02/09/2025 17:10, Thiago Adams escreveu:   
   > The type used by MSVC compiler seems not follow the C standard.   
   >   
   > I choose the number 2147483648 that is the next number after max signed   
   > i32.   
   >   
      
   For some reason GCC and clang have a warning (integer literal is too   
   large to be represented in a signed integer type) only for decimal form.   
      
   We have a warning for 18408377700990114895  but not for the same number   
   written as hex 0xff77b1fcbebcdc4f.   
      
      
   int main(){   
       static_assert(18408377700990114895 == 0xff77b1fcbebcdc4f);   
   }   
      
   https://godbolt.org/z/PPYErfrTP   
      
   But I don't think hex is especial in this case.   
      
   unsigned long long u[] = {18408377700990114895 , 0xff77b1fcbebcdc4f};   
      
   I think a suffix ULL maybe useful in this case.   
      
   --- 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