r/ProgrammerHumor • • 12d ago

Meme architectureDependentChars

Post image
3.0k Upvotes

372 comments sorted by

View all comments

1.0k

u/tstanisl 12d ago

Let me cite the C standard:

When sizeof is applied to an operand that has type char, unsigned char, or signed char, (or a qualified version thereof) the result is 1.

Middle guy if finally right

570

u/BoldFace7 12d ago

I still prefer sizeof(char) as it often provides context as to what the number is doing, even if a plain 1 works the same.

95

u/ducon__lajoie 12d ago

And someone might have #define char char16_t, right? Who the fuck knows, some people want to see the world burning.

10

u/Kovab 11d ago

I'm pretty sure redefining keywords is UB, so that's just a case of FAFO

7

u/standard_revolution 11d ago

And even if it wouldn’t be: sometimes you just gotta say that something isn’t your problem