the const
in printf()
's signature declares a promise printf()
makes -- it won't mess with the data pointed to by format
(therefore, both char*
and const char*
variables may be passed in for format
).
Now, your array is volatile
(and I expect you know the implication of that). The compiler warns you, that this volatility is discarded in printf()
's scope -- you won't get volatile semantics for accesses to format
within printf()
.
As a suggestion what to do, I'd say evaluate whether you really want changes to the data be apparent midst- printf()
. I can't see a reason for wanting that, so making a local copy sounds reasonable.