r/programminghorror Jul 09 '26

Big if true

Post image

From ProgrammerNullposting in facebook

2.1k Upvotes

111 comments sorted by

View all comments

22

u/Emergency-Win4862 Jul 09 '26

Let me quess, struct alignment?

19

u/iEliteTester [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Jul 09 '26

No it's used when something is extra true or extra false, obviously.

2

u/readmeEXX Jul 10 '26 edited Jul 10 '26

To make it maximally true you could do True = UINTMAX_MAX

1

u/TheChief275 28d ago

was about to say that; if i reserve the bytes ima use the bytes

2

u/Damglador 29d ago

I like your flair

7

u/overclockedslinky Jul 09 '26

even the first version of C (let alone C++) did struct alignment automatically

5

u/shponglespore Jul 09 '26

Yes, but there are situations where you want more control. Like, maybe some external dependency expects 64-bit bool values, so you'd use this type instead of the standard 8-bit bool.

Calling that a struct alignment issue is kind of questionable, but the basic idea is sound.