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" } */
5 
6 typedef __SIZE_TYPE__ size_t;
7 
f(char * dst,size_t n,const char * s)8 void f (char *dst, size_t n, const char *s)
9 {
10   if (n < 2 || __INT_MAX__ - 2 < n)
11     n = 2;
12 
13   __builtin_sprintf (dst, "%.*s %.*s", (int)n, s, (int)n, s);   /* { dg-bogus "INT_MAX" } */
14 }
15