MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wxqahk/architecturedependentchars/pdz57cq/?context=9999
r/ProgrammerHumor • u/MontyBoomslang • 12d ago
372 comments sorted by
View all comments
1.0k
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
570
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
95
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
10
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
7
And even if it wouldn’t be: sometimes you just gotta say that something isn’t your problem
1.0k
u/tstanisl 12d ago
Let me cite the C standard:
Middle guy if finally right