On 05/10/2011 10:57 AM, Paul Eggert wrote:
> Here's a proposed module to test 'intprops'.  It assumes the revised
> patch for integer overflow checking that I emailed a few minutes ago.
> 
> I don't know the recommended way to test this with gnulib-tool;
> I read the --help output and the documentation, but couldn't figure
> it out.  I tested it by hand, though.

./gnulib-tool --with-tests --test intprops

> +/* TYPE_IS_INTEGER.  */
...
> +verify (! TYPE_IS_INTEGER (long double));

Is TYPE_IS_INTEGER supposed to work on composite types?  In which case,
should we add things like:

verify (! TYPE_IS_INTEGER (void *));

> +verify (TYPE_SIGNED (intmax_t));
> +verify (! TYPE_SIGNED (uintmax_t));

Does TYPE_SIGNED work on floating types?  That is, should we add lines like:

verify (TYPE_SIGNED (double));

> +/* TYPE_MINIMUM, TYPE_MAXIMUM.  */
> +verify (TYPE_MINIMUM (char) == CHAR_MIN);

> +/* INT_STRLEN_BOUND, INT_BUFSIZE_BOUND.  */
> +#ifdef INT32_MAX

Isn't int32_t guaranteed by POSIX?

> +verify (INT_STRLEN_BOUND (int32_t) == sizeof ("-2147483648") - 1);
> +verify (INT_BUFSIZE_BOUND (int32_t) == sizeof ("-2147483648"));
> +#endif
> +#ifdef INT64_MAX

whereas I agree that int64_max is optional (but likely exists everywhere
these days, if via the gnulib replacements).

-- 
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to