bug-gnulib
[Top][All Lists]
Advanced

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

Re: undefined behaviour findings in bitset


From: Bruno Haible
Subject: Re: undefined behaviour findings in bitset
Date: Sun, 17 Mar 2019 20:27:12 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-141-generic; KDE/5.18.0; x86_64; ; )

Hi Akim,

> But GCC 4.7 does not support [[noreturn]] yet, even in gnu++11 mode.
> 
> I need something like the following changes.

> -# if 201103 <= (defined __cplusplus ? __cplusplus : 0)
> +# if (201103 <= (defined __cplusplus ? __cplusplus : 0) \
> +      && 4 < __GNUC__ + (8 <= __GNUC_MINOR__))

Something like this is OK. But this change drops support for [[noreturn]]
in compilers other than GCC and clang. Shouldn't it be like this:

   # if (201103 <= (defined __cplusplus ? __cplusplus : 0) \
         && (!defined __GNUC__ || 4 < __GNUC__ + (8 <= __GNUC_MINOR__)))

> Wouldn't it be useful to have a file that defines macros such as
> GL_GCC_VERSION (that is defined on GCC only, not clang, nor icc),
> GL_ICC_VERSION, etc.?

The effort to distribute (in a module) and include this file may well
be larger than the gain, no?

Also, in this case the code duplication is between a file in m4/ and
a file in lib/. However, we don't have a good way to share code between
m4/ and lib/, because an include statement in a .m4 file
  #include "$srcdir/lib/foo.h"
would need to reference the gnulib-tool --source-base value instead of 'lib'.

Bruno




reply via email to

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