title: How to suppress sprintf() warning 'directive writing between 1 and 11 bytes into a region of size 6 '
body: <p>I am using <code>sprintf()</code> to create a string, <code>literal</code> is an integer.</p>
  
  <pre><code>char tag[16];
  sprintf(tag, "Literal - %d", literal); 
  </code></pre>
  
  <p>But the project make is considering  all warnings as error and raising error: </p>
  
  <pre><code>error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 6 [-Werror=format-overflow=]  
     sprintf(tag, "Literal - %d", literal);    //snprintf(tag, 16, "Literal - %d", literal);  
             ^~   
  apps/ziptest/test_literals_lzma.c:42:15: note: directive argument in the range [-2147483648, 255]   sprintf(tag, "Literal - %d", literal);    //snprintf(tag, 16, "Literal
      - %d", literal);  
                     ^~~~~~~~~~~~~~   
  apps/ziptest/test_literals_lzma.c:42:2: note: ‘sprintf’ output between 12 and 22 bytes into a destination of size 16   sprintf(tag, "Literal - %d", literal);    //snprintf(tag, 16, "Literal - %d", literal);     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
  cc1: all warnings being treated as errors Makefile:370: recipe for target 
  </code></pre>
  
  <p>can this warning be avoided? (literal range is from 0 to 255)</p>