title: Using a volatile string as the format string with printf()
body: <p>Suppose I have the following function signature:</p>
  
  <pre><code>int printf(const char * restrict format, ... );
  </code></pre>
  
  <p>Now, I have a string defined as follows:</p>
  
  <pre><code>volatile char command_str[256];
  </code></pre>
  
  <p>Now, when I want to pass this string to my printf function, I will get the following warning:</p>
  
  <pre><code>Warning 32  [N] 2943 : passing 'volatile char [256]' to parameter of type 'const char *' discards qualifiers    C:\P\parameter\parameter.c
  </code></pre>
  
  <p>I do not want to change the <code>printf</code> signature, the easiest solution to make the warning go away would be </p>
  
  <pre><code>printf((const char*)command_str, .......);
  </code></pre>
  
  <p>I have a feeling that this is not the best solution. What would be the correct thing to do? I cannot make <code>command_str</code> non-volatile since it is accessed within an interrupt.</p>