[Bug c/84919] [8/9 Regression] error: passing argument 1 to restrict-qualified parameter aliases with argument 5 [-Werror=restrict]

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Aug 20 14:40:47 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84919

--- Comment #27 from Martin Sebor <msebor at gcc dot gnu.org> ---
The fix was applied to GCC 10 but not to GCC 9 or 8.  It will not be backported
there.  It can be suppressed by introducing a named temporary copy of the
pointer and using it as one other other argument to the function.

void f (char *p)
{
  char *q = p;
  sprintf (p, "%p", q);
}


More information about the Gcc-bugs mailing list