* 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 <bruno@clisp.org>
+
+ 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 <bruno@clisp.org>
uniname/uniname: Use module 'attribute'.
-# 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,
# 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.
tests/test-ignore-value.c
Depends-on:
+attribute
stdio
configure.ac:
#include <stdio.h>
-#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)