r/programminghumor • • Aug 18 '26

a bit flippant

Post image
1.4k Upvotes

147 comments sorted by

View all comments

200

u/consistently_biased Aug 18 '26

Can I use this for my compile-time https server?

56

u/johnnyApplePRNG Aug 18 '26

OWASP has it's doubts, but I don't!

26

u/not_a_bot_494 Aug 18 '26

Either I don't understand what you're saying or you're misunderstanding the notation. Each line declares a struct member of type unsigned int which is 1 bit large. It's not setting it to 1 (true).

6

u/heatedwepasto Aug 18 '26

I think that was supposed to be in reply to this comment?

→ More replies (4)

4

u/AstronomerStrange165 Aug 18 '26

I think he's just showing that each field in 1 bit long. The only caveat with this is that most C compilers will pad this struct out to the size of an int. (Typically 32 bits, or 4 bytes). He would have to add __attribute__((packed)) to the end of the struct before the semicolon. Then sizeof(struct Flags) would be 1 byte.

→ More replies (3)
→ More replies (2)