bug-gnulib
[Top][All Lists]
Advanced

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

Re: stdint_.h vs intmax_t & uintmax_t


From: Mark D. Baushke
Subject: Re: stdint_.h vs intmax_t & uintmax_t
Date: Mon, 14 Nov 2005 17:53:07 -0800

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul Eggert <address@hidden> writes:

> Does the following (untested) patch fix things for you?

Yes. Thank you.

> 2005-11-14  Paul Eggert  <address@hidden>
> 
>       * lib/stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
>       (uintmax_t) [defined uintmax_t]: Do not declare.
>       This works around a problem if intmax_t.m4 and/or uintmax_t.m4
>       are also used.  Problem reported by Mark D. Baushke.
> 
> --- stdint_.h.~1.7.~  2005-05-23 03:22:39.000000000 -0700
> +++ stdint_.h 2005-11-14 16:44:56.000000000 -0800
> @@ -133,11 +133,19 @@ typedef unsigned long uintptr_t;
>  /* 7.18.1.5. Greatest-width integer types */
>  
>  #ifdef _STDINT_H_HAVE_INT64
> +# ifndef intmax_t
>  typedef int64_t  intmax_t;
> +# endif
> +# ifndef uintmax_t
>  typedef uint64_t uintmax_t;
> +# endif
>  #else
> +# ifndef intmax_t
>  typedef int32_t  intmax_t;
> +# endif
> +# ifndef uintmax_t
>  typedef uint32_t uintmax_t;
> +# endif
>  #endif
>  
>  /* 7.18.2. Limits of specified-width integer types */

There is one remaining interaction with stdint_.h and config.h
which arises from m4/size_max.m4

% grep SIZE_MAX config.h 
config.h:#define SIZE_MAX 4294967295U
% grep lib/stdint_.h
#define SIZE_MAX (~(size_t)0)
%

source='../../lib/md5.c' object='md5.o' libtool=no  DEPDIR=.deps depmode=gcc /bi
n/bash ../../build-aux/depcomp  gcc -DHAVE_CONFIG_H -I. -I../../lib -I..    -I/u
sr/local/include -Ino/include  -g -O2 -c ../../lib/md5.c
In file included from ../../lib/md5.h:25,
                 from ../../lib/md5.c:27:
stdint.h:241: warning: `SIZE_MAX' redefined
../config.h:1002: warning: this is the location of the previous definition

        -- Mark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQFDeT+CCg7APGsDnFERAokfAJ9qoLnZXFAP2l2koelsBRqR38CqvgCg0FLv
+ipFgwL2CG1HntnqPC6+WLg=
=saOl
-----END PGP SIGNATURE-----




reply via email to

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