Skip to content

Commit

Permalink
Remove restrict keywords
Browse files Browse the repository at this point in the history
- They're not used anywhere else in fortify-headers
- It's breaking compilation on C++, because compatibility is hard

It was initially reported on https://gitlab.alpinelinux.org/alpine/aports/-/issues/16200
  • Loading branch information
jvoisin committed Jun 14, 2024
1 parent 1becad4 commit 6939e33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ _FORTIFY_FN(vprintf) int vprintf(const char *__f, __builtin_va_list __v)
#if __has_builtin(__builtin_vasprintf)
__diagnose_as_builtin(__builtin_vasprintf, 1, 2, 3)
#endif
_FORTIFY_FN(vasprintf) int vasprintf(char **restrict strp, const char *restrict fmt, __builtin_va_list ap)
_FORTIFY_FN(vasprintf) int vasprintf(char **strp, const char *fmt, __builtin_va_list ap)
{
#if __has_builtin(__builtin___vasprintf_chk) && USE_NATIVE_CHK
return __builtin___vasprintf_chk(_FORTIFY_SOURCE, strp, fmt, ap);
Expand Down Expand Up @@ -340,7 +340,7 @@ __fh_format(printf, 2, 0)
#if __has_builtin(__builtin_asprintf)
__diagnose_as_builtin(__builtin_asprintf, 2, 3)
#endif
_FORTIFY_FN(asprintf) int asprintf(char **restrict strp, const char *restrict fmt, ...)
_FORTIFY_FN(asprintf) int asprintf(char **strp, const char *fmt, ...)
{
#if __has_builtin(__builtin___asprintf_chk) && USE_NATIVE_CHK
return __builtin___asprintf_chk(_FORTIFY_SOURCE, strp, fmt, __builtin_va_arg_pack());
Expand Down

0 comments on commit 6939e33

Please sign in to comment.