aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr59119.c
blob: b026ba5d4ac88e7f41d04105fc66dd335cae1e97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
extern void *memmove (void *, const void *, __SIZE_TYPE__);
extern void *memset (void *, int, __SIZE_TYPE__);

typedef struct {
    long n_prefix;
    long n_spadding;
} NumberFieldWidths;

void
fill_number(char *buf, const NumberFieldWidths *spec)
{
    if (spec->n_prefix) {
        memmove(buf,
                (char *) 0,
                spec->n_prefix * sizeof(char));
        buf += spec->n_prefix;
    }
    if (spec->n_spadding) {
        memset(buf, 0, spec->n_spadding);
        buf += spec->n_spadding;
    }
}