Hacker News new | past | comments | ask | show | jobs | submit login

Clearly I'm missing something - in BadKarma, why does the compiler not baulk at sk_filter being passed a struct amp_mgr* instead of a struct sock* as expected? A type confusion like that ought to be prevented during typecheck, no?



It's indirected via `chan->data`, which is probably a `void*`. (Implicit) pointer casts between `void*` and other arbitrary types are allowed.





Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: