summaryrefslogtreecommitdiff
path: root/tests/test-ignore-value.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-05-08 18:30:01 +0200
committerBruno Haible <bruno@clisp.org>2020-05-08 18:41:56 +0200
commitcf9faba87af1487f8e8920947a8e45d45e2512d5 (patch)
tree87f5389d3026dc5dbe0f16783424142684cdd29e /tests/test-ignore-value.c
parentbcc6dbc771641246ec4a544e67e4dc3f03d578bd (diff)
downloadgnulib-cf9faba87af1487f8e8920947a8e45d45e2512d5.tar.gz
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.
Diffstat (limited to 'tests/test-ignore-value.c')
-rw-r--r--tests/test-ignore-value.c18
1 files changed, 6 insertions, 12 deletions
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 <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)