08c3a6
commit 14770f3e0462721b317f138197e1fbf4db542c94
08c3a6
Author: Sergei Trofimovich <slyich@gmail.com>
08c3a6
Date:   Mon May 23 13:56:43 2022 +0530
08c3a6
08c3a6
    string.h: fix __fortified_attr_access macro call [BZ #29162]
08c3a6
    
08c3a6
    commit e938c0274 "Don't add access size hints to fortifiable functions"
08c3a6
    converted a few '__attr_access ((...))' into '__fortified_attr_access (...)'
08c3a6
    calls.
08c3a6
    
08c3a6
    But one of conversions had double parentheses of '__fortified_attr_access (...)'.
08c3a6
    
08c3a6
    Noticed as a gnat6 build failure:
08c3a6
    
08c3a6
        /<<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
08c3a6
    
08c3a6
    The change fixes parentheses.
08c3a6
    
08c3a6
    This is seen when using compilers that do not support
08c3a6
    __builtin___stpncpy_chk, e.g. gcc older than 4.7, clang older than 2.6
08c3a6
    or some compiler not derived from gcc or clang.
08c3a6
    
08c3a6
    Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
08c3a6
    Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
08c3a6
    (cherry picked from commit 5a5f94af0542f9a35aaa7992c18eb4e2403a29b9)
08c3a6
08c3a6
diff --git a/string/bits/string_fortified.h b/string/bits/string_fortified.h
08c3a6
index 218006c9ba882d9c..4e66e0bd1ebb572a 100644
08c3a6
--- a/string/bits/string_fortified.h
08c3a6
+++ b/string/bits/string_fortified.h
08c3a6
@@ -107,7 +107,7 @@ __NTH (stpncpy (char *__dest, const char *__src, size_t __n))
08c3a6
 # else
08c3a6
 extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n,
08c3a6
 			    size_t __destlen) __THROW
08c3a6
-  __fortified_attr_access ((__write_only__, 1, 3))
08c3a6
+  __fortified_attr_access (__write_only__, 1, 3)
08c3a6
   __attr_access ((__read_only__, 2));
08c3a6
 extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, const char *__src,
08c3a6
 					       size_t __n), stpncpy);