Originally posted by Zan Lynx
View Post
My code is almost always type-checked and type-checkable statically, including and especially function pointers. The very few exceptions are checked (by hand) very carefully. I don't know about kernel code.
Although void * can point at any object in C, a function isn't an object. The C standard doesn't really provide an equivalent for pointers to functions. Unless it was added since I last looked carefully.
Putting a marker instruction on each function's object code certainly should not require anything like LTO. Why would it not be a completely separate flag?
Double ahh: after posting I saw the URLs. So this is catching function pointers overwritten at run-time. Not bad type-punning.
Leave a comment: