News for hackers. Stuff that matters.
Re:A bug story: data alignment in C on x86 (2016) by saagarjha on Tuesday September 04, 2018 @08:37PM (#17914146)
> it is the only correct way to access floating-point as int

Well, other than memcpy. And it's kinda sketchy in the way that they did it: it was a tacked-on footnote in the C99 standard retained through to C11.

> create an array of function pointers of different types

Well, void * * or char * * (spaces so Hacker News doesn’t eat it) would do just as well…

Re:A bug story: data alignment in C on x86 (2016) by caf on Tuesday September 04, 2018 @09:53PM (#17914522)
Function pointers aren't guaranteed to convert to and from object pointers.
Re:A bug story: data alignment in C on x86 (2016) by saagarjha on Wednesday September 05, 2018 @02:02AM (#17915379)
Oops, sorry, that's POSIX and not the C standard. I must have gotten them mixed up. Thanks for the correction!