comparison gcc/testsuite/gcc.dg/analyzer/compound-assignment-3.c @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
comparison
equal deleted inserted replaced
145:1830386684a0 152:2b5abeee2509
1 #include <stdlib.h>
2
3 struct union_wrapper
4 {
5 union
6 {
7 int i;
8 void *ptr;
9 } u;
10 };
11
12 struct union_wrapper
13 test_1 (void)
14 {
15 struct union_wrapper uw1;
16 uw1.u.ptr = malloc (1024);
17 return uw1;
18 }
19
20 struct union_wrapper
21 test_2 (void)
22 {
23 struct union_wrapper uw2;
24 uw2.u.ptr = malloc (1024);
25 } /* { dg-warning "leak of '\\(void \\*\\)uw2.u'" } */