Re:A bug story: data alignment in C on x86 (2016)
by caf on Tuesday September 04, 2018 @10:02PM
(#17914547)
You don't actually need a cast to write a qsort comparison function, because void * is implicitly converted to and from other pointer types in C. Eg:
On the other hand, pointer casts are needed if you want to write a function like strchr() (where you can pass a const-qualified pointer, but want to return an unqualified pointer for the case where an unqualified pointer was passed).
[ Parent
| on HN ]