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
typedef void (*fp)(int *i); // given checked type
void simplefunc(int *i) {
i = (int*)1; // unsafe - function will not be _Checked
}
void test(void) {
fp func = simplefunc; // fail compilation: assign unchecked to checked
}
3C completes but clang won't accept the function pointer initialization in test. If simplefunc were checked, or even declared but undefined, clang would accept it. This may be another case for having an unchecked variant of a typedef (see #389).
The text was updated successfully, but these errors were encountered:
Does this work if you explicitly take the address of simplefunc? I think this might be a Checked C compiler bug where it doesn't handle implicit conversion from function to function pointer correctly.
In this simplification of a vsftpd error:
3C completes but clang won't accept the function pointer initialization in
test
. Ifsimplefunc
were checked, or even declared but undefined, clang would accept it. This may be another case for having an unchecked variant of a typedef (see #389).The text was updated successfully, but these errors were encountered: