Comment

Comment by kazinator

You're supposed to know that bitfields undergo promotion as they were small integers, even if they are declared to be something like unsigned int.

Therefore, convert the values before operating on them:

    u1 = ((uint64_t) bf.uf1) << 20;
    u2 = ((uint64_t) bf.uf2) << 20;
parent kazinator 7 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton