LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Why is a UINT_MAX 64 bits on 32 bit linux OS? (https://www.linuxquestions.org/questions/linux-kernel-70/why-is-a-uint_max-64-bits-on-32-bit-linux-os-4175563969/)

dfatlq 01-14-2016 05:44 PM

Why is a UINT_MAX 64 bits on 32 bit linux OS?
 
Linux debianvm 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux

This is true:

#if UINT_MAX == 0xFFFFFFFFFFFFFFFFULL
#error UINT_MAX
#endif


?

dfatlq 01-14-2016 06:11 PM

I have a feeling it's the preprocessor since they define it as ~0U

it fails this:

#if UINT_MAX == 0xFFFFFFFFU

but it should be the same.

dfatlq 01-15-2016 05:39 PM

Yes, that's what it is, gcc / g++ doesn't handle ~0U as expected since U should make it an unsigned int in the preprocessor (ULL for larger values). That's the way all the other compilers I've used over the years work.


All times are GMT -5. The time now is 10:19 PM.