HNHacker News
TopNewBestAskShowJobs

wyufro

50 karma · joined May 22, 2016

submissionscomments
wyufro··on Fixing the MacBook Pro
They’re glued and can’t be placed back if taken. There’s no hooks or clamps, I think you’re thinking of the older keyboards.

I know this firsthand as I’ve removed one key. It’s now lose on the keyboard but mostly works anyway. Still, I have no love for this keyboard, 4-5 keys are semi stuck and have been for some time.

wyufro··on IPv6 Adoption
No, they have different functions. Sending to ::1.2.3.4 would send an IPv6-in-IPv4 packet to 1.2.3.4. Using ::ffff:1.2.3.4 tells the OS that you want to send a proper IPv4 packet and no IPv6 is used on the wire.

I don't know why the former was deprecated, but I think almost no OS supported it so might've been just that.

wyufro··on Tagged unions, or ‘variants’, in C
> It relies on struct layout, and if anything has wider alignment than ptrdiff_t, it's broken.

I think you're wrong about this. I'm pretty certain a pointer to a struct is always equivilent to a pointer to the first member, except for the type. I went and looked it up in C11 (6.7.2.1 point 15):

> A pointer to a structure object, suitably converted, points to its initial member (or if that member is a bit-field, then to the unit in which it resides), and vice versa. There may be unnamed padding within a structure object, but not at its beginning.

Edit: A duh, the + sizeof(ptrdiff_t) is the part that's wrong. Yeah, agreed.

wyufro··on Memfile.h – Reading files from memory with fscanf
This is a standard POSIX function: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fm... ISTR Windows also has a version, with a different name.
← PreviousPage 2 of 2