]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
string.h: fix __fortified_attr_access macro call [BZ #29162]
authorSergei Trofimovich <slyich@gmail.com>
Mon, 23 May 2022 08:26:43 +0000 (13:56 +0530)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Mon, 23 May 2022 08:26:43 +0000 (13:56 +0530)
commit e938c0274 "Don't add access size hints to fortifiable functions"
converted a few '__attr_access ((...))' into '__fortified_attr_access (...)'
calls.

But one of conversions had double parentheses of '__fortified_attr_access (...)'.

Noticed as a gnat6 build failure:

    /<<NIX>>-glibc-2.34-210-dev/include/bits/string_fortified.h:110:50: error: macro "__fortified_attr_access" requires 3 arguments, but only 1 given

The change fixes parentheses.

This is seen when using compilers that do not support
__builtin___stpncpy_chk, e.g. gcc older than 4.7, clang older than 2.6
or some compiler not derived from gcc or clang.

Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
string/bits/string_fortified.h

index f4a5dfc2e5e9fded9f26c739f3fac12237d07031..149ebbb08b226ac22d0221b1e6a3ee22efc0a6ed 100644 (file)
@@ -107,7 +107,7 @@ __NTH (stpncpy (char *__dest, const char *__src, size_t __n))
 # else
 extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n,
                            size_t __destlen) __THROW
-  __fortified_attr_access ((__write_only__, 1, 3))
+  __fortified_attr_access (__write_only__, 1, 3)
   __attr_access ((__read_only__, 2));
 extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, const char *__src,
                                               size_t __n), stpncpy);