Re: [PATCH] verify: use _Static_assert if available

2011-04-09 Thread Bruno Haible
Pádraig Brady wrote: > > /* The condition (99 < __GNUC__) is temporary, until we know about the > >first G++ release that supports static_assert. */ > > # if (99 < __GNUC__) && defined __cplusplus > > # define HAVE_STATIC_ASSERT 1 > > # endif > > > g++ supports static_assert since 4.3 I thin

Re: [PATCH] verify: use _Static_assert if available

2011-04-09 Thread Pádraig Brady
On 09/04/11 01:14, Bruno Haible wrote: > Hi Paul, > >>> +# if 0 && defined __cplusplus >>> +# define HAVE_STATIC_ASSERT 1 >>> +# endif >> >> That "0 &&" looks wrong: did you put it in for debugging, >> and intend to remove it before installing? > > The intent of this "0" condition was to be a pl

Re: [PATCH] verify: use _Static_assert if available

2011-04-08 Thread Bruno Haible
Hi Paul, > > +# if 0 && defined __cplusplus > > +# define HAVE_STATIC_ASSERT 1 > > +# endif > > That "0 &&" looks wrong: did you put it in for debugging, > and intend to remove it before installing? The intent of this "0" condition was to be a placeholder until GCC 4.7 or 4.8 or whatever releas

Re: [PATCH] verify: use _Static_assert if available

2011-04-08 Thread Paul Eggert
On 04/08/2011 12:30 PM, Bruno Haible wrote: > Here's a proposed patch to fix it. Thanks, that looks good, except: > +# if 0 && defined __cplusplus > +# define HAVE_STATIC_ASSERT 1 > +# endif That "0 &&" looks wrong: did you put it in for debugging, and intend to remove it before installing?

Re: [PATCH] verify: use _Static_assert if available

2011-04-08 Thread Bruno Haible
Pádraig Brady wrote: > So C++0x support in gcc 4.6.0 is using static_assert() > while C1X support is using _Static_assert(). ISO C1X draft n1548 [1] defines _Static_assert as a keyword (A.1.2). The meaning of _Static_assert is defined in section 6.7.10: 6.7.10 Static assertions Syntax

Re: [PATCH] verify: use _Static_assert if available

2011-04-08 Thread Paul Eggert
On 04/08/2011 09:30 AM, Pádraig Brady wrote: > So C++0x support in gcc 4.6.0 is using static_assert() > while C1X support is using _Static_assert(). > Why the divergence in the standards? Sorry, I don't know, as I don't use C++. > Do we need to enforce the gcc option --std=c1x > to enable this as

Re: [PATCH] verify: use _Static_assert if available

2011-04-08 Thread Pádraig Brady
On 05/04/11 03:26, Paul Eggert wrote: > This gnulib patch modifies "verify" to use C1X's _Static_assert if > running GCC 4.6.0 or later, which generates easier-to-read > diagnostics. I haven't pushed this yet because I thought it wouldn't > hurt to get more pairs of eyes to look at it. So C++0x s

Re: [PATCH] verify: use _Static_assert if available

2011-04-05 Thread Paul Eggert
On 04/05/2011 03:21 PM, Bruno Haible wrote: > Isn't the first part of this condition a bit optimistic? I suppose it is. Chalk me down as Candide. I installed the patch without the __STDC_VERSION__ business, and thanks to Eric and you for the reviews.

Re: [PATCH] verify: use _Static_assert if available

2011-04-05 Thread Bruno Haible
Hi Paul, > +# if (201104 <= __STDC_VERSION__ \ > + || 4 < __GNUC__ || (__GNUC__ == 4 && 6 <= __GNUC_MINOR__)) > +# define HAVE__STATIC_ASSERT 1 Isn't the first part of this condition a bit optimistic? I think that experience in the past has shown that compiler vendors tend to bump the __STD

Re: [PATCH] verify: use _Static_assert if available

2011-04-05 Thread Eric Blake
On 04/04/2011 08:26 PM, Paul Eggert wrote: > This gnulib patch modifies "verify" to use C1X's _Static_assert if > running GCC 4.6.0 or later, which generates easier-to-read > diagnostics. I haven't pushed this yet because I thought it wouldn't > hurt to get more pairs of eyes to look at it. Cool

[PATCH] verify: use _Static_assert if available

2011-04-04 Thread Paul Eggert
This gnulib patch modifies "verify" to use C1X's _Static_assert if running GCC 4.6.0 or later, which generates easier-to-read diagnostics. I haven't pushed this yet because I thought it wouldn't hurt to get more pairs of eyes to look at it. diff --git a/ChangeLog b/ChangeLog index db0800c..3f3141