summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr62090-2.c
blob: af82edeb4e8190b9b6d6aa3dbd844458da211929 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* { dg-do compile } */
/* { dg-options "-O2" } */

typedef __SIZE_TYPE__ size_t;
extern __inline __attribute__ ((__always_inline__))
__attribute__ ((__gnu_inline__)) int
snprintf (char *__restrict __s, size_t __n, const char *__restrict __fmt, ...)
{
  return __builtin___snprintf_chk (__s, __n, 2 - 1,
				   __builtin_object_size (__s, 2 > 1),
				   __fmt, __builtin_va_arg_pack ());
}
typedef struct apacket apacket;
struct apacket {
    unsigned char data[4096];
};
static size_t fill_connect_data(char *buf, size_t bufsize)
{
  return snprintf(buf, bufsize, "host::") + 1;
}
unsigned send_connect(apacket *cp)
{
  return fill_connect_data((char *)cp->data, sizeof(cp->data));
}