blob: 797c759f8b631897d3764225f688f3ff727def19 (
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
25
26
27
28
29
30
31
32
33
34
35
36
|
#define __safe __attribute__((safe))
static void test_safe(void)
{
int obj;
int __safe *ptr;
int __safe *ptr2 = ptr;
typeof(ptr) ptr3 = ptr;
typeof(*ptr) var2 = obj;
int __safe var3 = obj;
int *ptr4 = &obj;
int *ptr5 = ptr; // KO
typeof(*ptr) sobj;
typeof(&sobj) ptr6 = &obj;
typeof(&sobj) ptr7 = ptr; // KO
obj = obj;
ptr = ptr;
obj = *ptr;
ptr = (int __safe *) &obj;
}
/*
* check-name: typeof-safe
*
* check-error-start
typeof-safe.c:13:21: warning: incorrect type in initializer (different modifiers)
typeof-safe.c:13:21: expected int *ptr5
typeof-safe.c:13:21: got int [safe] *ptr
typeof-safe.c:17:30: warning: incorrect type in initializer (different modifiers)
typeof-safe.c:17:30: expected int *ptr7
typeof-safe.c:17:30: got int [safe] *ptr
* check-error-end
*/
|