annotate gcc/testsuite/gcc.dg/m-un-2.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-options "-W -Wall" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 typedef __SIZE_TYPE__ size_t;
kono
parents:
diff changeset
5 extern void* malloc (size_t);
kono
parents:
diff changeset
6 extern void free (void*);
kono
parents:
diff changeset
7 extern void* realloc (void*, size_t);
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 struct vtable {
kono
parents:
diff changeset
10 void* (* _malloc) (size_t);
kono
parents:
diff changeset
11 void (* _free) (void*);
kono
parents:
diff changeset
12 void* (* _realloc) (void*, size_t); /* { dg-line vtable_realloc } */
kono
parents:
diff changeset
13 };
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 struct vtable mtable = {
kono
parents:
diff changeset
16 malloc,
kono
parents:
diff changeset
17 free
kono
parents:
diff changeset
18 }; /* { dg-warning "missing initializer" "warning regression" } */
kono
parents:
diff changeset
19 /* { dg-message "declared here" "warning regression 2" { target *-*-* } vtable_realloc } */
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 /* With designated initializers, we assume you meant to leave out the
kono
parents:
diff changeset
22 initialization of any blank fields. */
kono
parents:
diff changeset
23 struct vtable mtable2 = {
kono
parents:
diff changeset
24 ._malloc = malloc,
kono
parents:
diff changeset
25 ._realloc = realloc
kono
parents:
diff changeset
26 };
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 struct vtable mtable3 = {
kono
parents:
diff changeset
29 ._free = free,
kono
parents:
diff changeset
30 ._malloc = malloc,
kono
parents:
diff changeset
31 ._realloc = realloc
kono
parents:
diff changeset
32 };