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

Any pointer converts to void* without warning. That's pretty weak.



This is the point of void*, one does not have to use it.


void* malloc(size_t size);

void free(void *ptr);

You use it a lot more than you think ;)


This is not a type safety issue though. For malloc the size has to agree. But in any case, you could wrap it into type-aware allocation demonstrating that this is not a limitation of the type system.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: