bug-gnulib
[Top][All Lists]
Advanced

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

[bug-gnulib] Re: size_max


From: Simon Josefsson
Subject: [bug-gnulib] Re: size_max
Date: Sat, 22 Jan 2005 16:49:07 +0100
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Stepan Kasal <address@hidden> writes:

> Hi,
>
> On Fri, Jan 21, 2005 at 11:20:13PM +0100, Simon Josefsson wrote:
>> Paul Eggert <address@hidden> writes:
>> 
>> >> +#ifndef GNULIB_SIZE_MAX_H
>> >> +#define GNULIB_SIZE_MAX_H
>> >> +
>> >> +# include <limits.h>
>> >> +# if HAVE_STDINT_H
>> >> +#  include <stdint.h>
>> >> +# endif
>> >> +
>> >> +#endif /* GNULIB_SIZE_MAX_H */
>> >
>> > You can systematically replace GNULIB_SIZE_MAX_H with SIZE_MAX; one
>> > less symbol to worry about.  (Or is that too cute?  :-)
>> 
>> Except for the #define, I suppose.  POSIX says SIZE_MAX should be
>> usable in #if directives, so I think the neat trick will work.
>
> but without the define, you'd probably disable an optimisation on the
> preprocessing.

Really?  Including limits.h and optionally stdint.h should define
SIZE_MAX, so the header file would not be parsed more than once.

I assume we are talking about:

#ifndef SIZE_MAX

# include <limits.h>
# if HAVE_STDINT_H
#  include <stdint.h>
# endif

#endif /* SIZE_MAX */

> I think GNULIB_SIZE_MAX_H is fine.

I agree, it is more consistent and less confusing.

Thanks.




reply via email to

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