bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HP-UX 11.23 stdint failure (was: snapshot 3 in preparation for 1.4.


From: Gary V. Vaughan
Subject: Re: HP-UX 11.23 stdint failure (was: snapshot 3 in preparation for 1.4.13)
Date: Thu, 26 Feb 2009 02:36:14 +0700

Hi Eric,

2009/2/26 Eric Blake <address@hidden>:
> Gary V. Vaughan <gary <at> gnu.org> writes:
>
>> > 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
>
> Yep.  l7 and l8 demonstrate bugs in the system header's UINT8_C and UINT16_C -
> they should result in 255 and 65535 (not 255u and 65535u).  So how come this
> check in stdint.m4 is not detecting it?
>
> #include <stdint.h>
> struct s{
>  /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others.  */
>  int check_UINT8_C:
>        (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
>  int check_UINT16_C:
>        (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
> };
>
> What is uint_least8_t typedef'd to?

% find /usr/include -name '*.h' -exec egrep 'uint_least[136]?[2486]_t' {} \; \
  | grep typedef
typedef unsigned char uint_least8_t;
typedef unsigned short uint_least16_t;
typedef unsigned int uint_least32_t;
typedef uint64_t uint_least64_t;

> What does the above snippet give when preprocessed?

Again, minus system preamble:

#line 2 "x.c"
struct s{

 int check_UINT8_C:
       (-1 < ((unsigned char)(0))) == (-1 < (uint_least8_t) 0) ? 1 : -1;
 int check_UINT16_C:
       (-1 < ((unsigned short)(0))) == (-1 < (uint_least16_t) 0) ? 1 : -1;
};

Cheers,
    Gary
-- 
Email me:          address@hidden                        (\(\
Read my blog:      http://blog.azazil.net              ( o.O)
And my other blog: http://www.machaxor.net              (uu )o
...and my book:    http://sources.redhat.com/autobook  ("("_)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]