title: Passing volatile array to strncpy
body: <p>In my ISR I have a buffer that gets stuffed from the USART so I declared the buffer as volatile:</p>
  
  <pre><code>volatile uint8_t RxBuffer1[BUFFER_LENGTH];
  </code></pre>
  
  <p>Ok, no problem there.  I believe that is standard practice.</p>
  
  <p>Somewhere in main() I need to copy a portion of that array since the array is a circular buffer and will get obliterated at sometime in the future:</p>
  
  <pre><code>strncpy(Data, RxBuffer1, len);
  </code></pre>
  
  <p>Oh but this is a no no!  my compiler dutifully tells me:</p>
  
  <blockquote>
    <p>passing argument 2 of 'strncpy' discards 'volatile' qualifier from pointer target type</p>
  </blockquote>
  
  <p>since strncpy makes 's2' a const char *</p>
  
  <p>I don't think I'm doing anything that hasn't been done as standard practice.  How do I do this correctly?</p>