title: How to circumvent format-truncation warning in GCC?
body: <p>I'm getting the following gcc format-truncation warning:</p>
  
  <pre><code>test.c:8:33: warning: ‘/input’ directive output may be truncated writing 6 bytes into a region of size between 1 and 20 [-Wformat-truncation=]
  snprintf(dst, sizeof(dst), "%s-more", src);
                               ^~~~~~
  test.c:8:3: note: ‘snprintf’ output between 7 and 26 bytes into a destination of size 20
  snprintf(dst, sizeof(dst), "%s-more", src);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  </code></pre>
  
  <p>on code like this:</p>
  
  <pre><code>char dst[20];
  char src[20];
  scanf("%s", src);
  snprintf(dst, sizeof(dst), "%s-more", src);
  printf("%s\n", dst);
  </code></pre>
  
  <p>I'm aware that it might be truncated - but this is exactly the reason why I'm using snprintf in the first place. Is there a way how to make it clear to the compiler that this is intended (without using a pragma or -Wno-format-truncation)?</p>