Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wouldn't so much call it "bad form" as just non-idiomatic. It doesn't really have big downsides in practice.

It's mostly a habit people pick up from C++ (where it's mandatory due to stricter typing), and if you want to build C code with a C++ compiler, you need to add the casts.

Given Microsoft's C++ fetish, I'm unsurprised by this.



I suppose one downside would be if you cast a voidptr to a pointer to (an element that has a different size), then calling operator++ moves it by more than if you had left it as a voidptr.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: