On 12 December 2014 at 04:40, Daiki Ueno <[email protected]> wrote: > Will Newton <[email protected]> writes: > >>> As a minor nitpicking, I'm not sure if we can join the intervals of >>> copyright years. How about using update-copyright in Gnulib? >> >> The reason I did this is that matches the copyright in glibc, which >> has the practice of using the full range of years for most files >> including the intl ones. > > I don't have strong opinion here, but: > >> https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html > > This also contains: > > "You can use a range (‘2008-2010’) instead of listing individual years > (‘2008, 2009, 2010’) if and only if: 1) every year in the range, > inclusive, really is a “copyrightable” year that would be listed > individually; and 2) you make an explicit statement in a README file > about this usage." > > I guess we should at least have the statement in README, like glibc. > > By the way: > >> Test HAVE_DECL_FGETS_UNLOCKED with #ifdef rather than #if. >> Test HAVE_DECL_FEOF_UNLOCKED with #ifdef rather than #if. > >> -#if defined _LIBC_REENTRANT || HAVE_DECL_FGETS_UNLOCKED >> +#if defined _LIBC_REENTRANT || defined HAVE_DECL_FGETS_UNLOCKED > > This is no-no. On some platforms (e.g. Mac OS X), > HAVE_DECL_FGETS_UNLOCKED will be defined as 0: > > $ grep 'define HAVE_DECL_FGETS' gettext-runtime/config.h > #define HAVE_DECL_FGETS_UNLOCKED 0 > > What's the rationale behind this change? According to C99 and C11, the > C preprocessor shall convert undefined identifiers to pp-number 0 before > evaluation.
glibc quite recently switched to passing -Wundef to the compiler which requires that #if is only used on defined values in order to catch bugs where somebody forgets or typos the name of a define. The usual way of testing config variables that start with HAVE_ is to use #ifdef as they are binary on/off switches. Is there a reason this constant must distinguish between not-defined and zero? Converting it to: #if defined _LIBC_REENTRANT || (defined HAVE_DECL_FGETS_UNLOCKED && HAVE_DECL_FGETS_UNLOCKED) should work but it is a bit ugly. -- Will Newton Toolchain Working Group, Linaro
