[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: HP-UX 11.23 stdint failure
From: |
Eric Blake |
Subject: |
Re: HP-UX 11.23 stdint failure |
Date: |
Wed, 25 Feb 2009 21:04:15 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Gary V. Vaughan <gary <at> gnu.org> writes:
> > Gary V. Vaughan <gary <at> gnu.org> writes:
>
> #define INT8_C(__c) (__c)
> #define UINT8_C(__c) __CONCAT_U__(__c)
> #define INT8_MAX INT8_C(127)
>
> >
> >> > l7 UINT8_MAX
> >> > l8 UINT16_MAX
> >> > l9 UINT32_MAX
> >> > =============================================
> >> > $ cc -AC99 i.c
> >>
> >> Trimming the system files fat leaves:
> >>
> >> l7 255u
> >> l8 65535u
> >> l9 4294967295ul
> >
> > int check_UINT8_C:
> > (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
>
> int check_UINT8_C:
> (-1 < ((unsigned char)(0))) == (-1 < (uint_least8_t) 0) ? 1 : -1;
OK, I'm officially confused now. How does "__CONCAT_U__(0)" result
in "((unsigned char)(0))", but UINT8_MAX results in "255u"? Actually, I don't
think you've yet posted what the headers use in the definition of UINT8_MAX, so
I'm not even sure it uses UINT8_C. Also, I don't recall seeing the 64-bit magic
in action, to figure out what __CONCAT_L__ does.
Just for the record, what does the preprocessor do on this:
#include <stdint.h>
l1 UINT8_MAX
l2 UINT8_C(255)
l3 UINT8_C(0)
l4 INT64_MAX
l5 INT64_MIN
l6 UINT64_MAX
l7 INT64_C(0)
l8 UINT64_C(0)
And does it make a difference which of these four possibilities you use?
1. #include <stdint.h>
2. #include <inttypes.h>
3. #include <stdint.h>
#include <inttypes.h>
4. #include <inttypes.h>
#include <stdint.h>
--
Eric Blake
Re: HP-UX 11.23 stdint failure, Eric Blake, 2009/02/25