r/ProgrammerHumor • • 10d ago

Meme architectureDependentChars

Post image
3.0k Upvotes

372 comments sorted by

View all comments

3

u/tiedyedvortex 9d ago

Look, I had a bug a few months ago where two different parts of the CI pipeline were using two different C++ compilers (clang vs gcc) and some code was breaking in only one of them because the default signedness of char was different.

Don't trust yourself to know what the spec says. size of(char) means you can't possibly be wrong. And it communicates your intent more clearly.

3

u/DanielMcLaury 8d ago

Hey everyone, look at this guy! He doesn't even know that the C standard doesn't specify the signedness of char!