Skip to content

Commit 4b25eec

Browse files
committed
Update based on review feedback
1 parent 1e9fce8 commit 4b25eec

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

clang/test/Sema/warn-cast-function-type-win.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ void test(void) {
2323
// return type to test1_type, but FARPROC1 has no prototype and so checking
2424
// is disabled for further compatibility issues. In C++ mode, all functions
2525
// have a prototype and so the check happens.
26-
test1_type t1 = (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_type t1 = (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+
2830
// This case is diagnosed in both C and C++ modes on Linux because the return
2931
// type of FARPROC2 does not match the return type of test2_type.
30-
test2_type t2 = (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_type t2 = (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}}
3235
}
3336

0 commit comments

Comments
 (0)