summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/strncpy-fix-1.c
blob: b8bc916e00896f74e544c1bb5ad0f046b9993cf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
/* Test that use of strncpy does not result in a "value computed is
   not used" warning.  */
/* { dg-do compile } */
/* { dg-options "-O2 -Wall" } */

#include <string.h>
void
f (char *s)
{
  strncpy (s, "::", 2);
}