[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/4] stat: fix up __attribute__ (const) declarations
From: |
Pádraig Brady |
Subject: |
[PATCH 3/4] stat: fix up __attribute__ (const) declarations |
Date: |
Mon, 3 Jun 2019 03:55:51 +0100 |
* src/stat.c (format_to_mask): Functions that inspect
memory of pointer arguments must not be declared const.
Also use the _GL_ATTRIBUTE_PURE defines which will be
set appropriately per compiler.
---
src/stat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/stat.c b/src/stat.c
index fe52e0f..3e8f531 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -1078,7 +1078,7 @@ print_esc_char (char c)
putchar (c);
}
-static size_t __attribute__((pure))
+static size_t _GL_ATTRIBUTE_PURE
format_code_offset (char const* directive)
{
size_t len = strspn (directive + 1, printf_flags);
@@ -1456,7 +1456,7 @@ fmt_to_mask (char fmt)
return 0;
}
-static unsigned int __attribute__((const))
+static unsigned int _GL_ATTRIBUTE_PURE
format_to_mask (char const *format)
{
unsigned int mask = 0;
--
2.9.3