You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: clang/test/Sema/warn-cast-function-type-win.c
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -23,11 +23,14 @@ void test(void) {
23
23
// return type to test1_type, but FARPROC1 has no prototype and so checking
24
24
// is disabled for further compatibility issues. In C++ mode, all functions
25
25
// have a prototype and so the check happens.
26
-
test1_typet1= (test1_type)GetProcAddress1(); // linux-cpp-warning {{cast from 'FARPROC1' (aka 'int (*)()') to 'test1_type' (aka 'int (*)(int)') converts to incompatible function type}} \
27
-
strict-warning {{cast from 'FARPROC1' (aka 'int (*)()') to 'test1_type' (aka 'int (*)(int)') converts to incompatible function type}}
26
+
test1_typet1= (test1_type)GetProcAddress1();
27
+
// linux-cpp-warning@-1 {{cast from 'FARPROC1' (aka 'int (*)()') to 'test1_type' (aka 'int (*)(int)') converts to incompatible function type}}
28
+
// strict-warning@-2 {{cast from 'FARPROC1' (aka 'int (*)()') to 'test1_type' (aka 'int (*)(int)') converts to incompatible function type}}
29
+
28
30
// This case is diagnosed in both C and C++ modes on Linux because the return
29
31
// type of FARPROC2 does not match the return type of test2_type.
30
-
test2_typet2= (test2_type)GetProcAddress2(); // linux-warning {{cast from 'FARPROC2' (aka 'unsigned long long (*)()') to 'test2_type' (aka 'float (*)()') converts to incompatible function type}} \
31
-
strict-warning {{cast from 'FARPROC2' (aka 'unsigned long long (*)()') to 'test2_type' (aka 'float (*)()') converts to incompatible function type}}
32
+
test2_typet2= (test2_type)GetProcAddress2();
33
+
// linux-warning@-1 {{cast from 'FARPROC2' (aka 'unsigned long long (*)()') to 'test2_type' (aka 'float (*)()') converts to incompatible function type}}
34
+
// strict-warning@-2 {{cast from 'FARPROC2' (aka 'unsigned long long (*)()') to 'test2_type' (aka 'float (*)()') converts to incompatible function type}}
0 commit comments