Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr79275.c
blobd3145245bfbd53d2e16af760e02715a27822952d
1 /* PR middle-end/79275 - -Wformat-overflow false positive exceeding INT_MAX
2 in glibc sysdeps/posix/tempname.c
3 { dg-do compile }
4 { dg-options "-O2 -Wall -Wformat-overflow=1 -ftrack-macro-expansion=0" } */
6 typedef __SIZE_TYPE__ size_t;
8 void f (char *dst, size_t n, const char *s)
10 if (n < 2 || __INT_MAX__ - 2 < n)
11 n = 2;
13 __builtin_sprintf (dst, "%.*s %.*s", (int)n, s, (int)n, s); /* { dg-bogus "INT_MAX" } */