I am fully aware of the existence of this question.
However, printf_s considers presence of specifier %n as an error, thus no write operation to format would ever be expected from printf_s. What sense does restrict make here?
I am fully aware of the existence of this question.
However, printf_s considers presence of specifier %n as an error, thus no write operation to format would ever be expected from printf_s. What sense does restrict make here?
A function parameter of pointer to character type can not only alias other function parameters but also global objects. In particular, since printf and printf_s modify stdout, any pointer to character type could, in principle, point to the same FILE object or other objects that an implementation might use for IO under the hood.
This is a bit far fetched, but basically this restrict here and in many other places says, don't try to be funny and use a separate character array for your format.