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); }