From: Bruno Haible Date: Fri, 8 May 2020 16:30:01 +0000 (+0200) Subject: ignore-value tests: Use module 'attribute'. X-Git-Tag: v1.0~4123 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cf9faba87af1487f8e8920947a8e45d45e2512d5;p=thirdparty%2Fgnulib.git ignore-value tests: Use module 'attribute'. * m4/gnulib-common.m4 (gl_COMMON_BODY): Fix a typo. * tests/test-ignore-value.c: Include attribute.h. (_GL_ATTRIBUTE_RETURN_CHECK): Remove macro. Use NODISCARD instead. * modules/ignore-value-tests (Depends-on): Add attribute. --- diff --git a/ChangeLog b/ChangeLog index 56c15bce4c..6f154d5137 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2020-05-08 Bruno Haible + + ignore-value tests: Use module 'attribute'. + * m4/gnulib-common.m4 (gl_COMMON_BODY): Fix a typo. + * tests/test-ignore-value.c: Include attribute.h. + (_GL_ATTRIBUTE_RETURN_CHECK): Remove macro. Use NODISCARD instead. + * modules/ignore-value-tests (Depends-on): Add attribute. + 2020-05-08 Bruno Haible uniname/uniname: Use module 'attribute'. diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 79771599bc..f4ba5e3a00 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 49 +# gnulib-common.m4 serial 50 dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -96,7 +96,7 @@ AC_DEFUN([gl_COMMON_BODY], [ # define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9) # define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0) # define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7) -# define _GL_ATTR_warn_unused_result_GL_GNUC_PREREQ (3, 4) +# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4) #endif ]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's _Alignas instead. diff --git a/modules/ignore-value-tests b/modules/ignore-value-tests index 9c8c6d6f1a..855d771936 100644 --- a/modules/ignore-value-tests +++ b/modules/ignore-value-tests @@ -2,6 +2,7 @@ Files: tests/test-ignore-value.c Depends-on: +attribute stdio configure.ac: diff --git a/tests/test-ignore-value.c b/tests/test-ignore-value.c index f323a7bfa3..9d5511515d 100644 --- a/tests/test-ignore-value.c +++ b/tests/test-ignore-value.c @@ -23,20 +23,14 @@ #include -#ifndef _GL_ATTRIBUTE_RETURN_CHECK -# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4) -# define _GL_ATTRIBUTE_RETURN_CHECK -# else -# define _GL_ATTRIBUTE_RETURN_CHECK __attribute__((__warn_unused_result__)) -# endif -#endif +#include "attribute.h" struct s { int i; }; -static char doChar (void) _GL_ATTRIBUTE_RETURN_CHECK; -static int doInt (void) _GL_ATTRIBUTE_RETURN_CHECK; -static off_t doOff (void) _GL_ATTRIBUTE_RETURN_CHECK; -static void *doPtr (void) _GL_ATTRIBUTE_RETURN_CHECK; -static struct s doStruct (void) _GL_ATTRIBUTE_RETURN_CHECK; +static char doChar (void) NODISCARD; +static int doInt (void) NODISCARD; +static off_t doOff (void) NODISCARD; +static void *doPtr (void) NODISCARD; +static struct s doStruct (void) NODISCARD; static char doChar (void)