https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44179

--- Comment #3 from Zack Weinberg <zack+srcbugz at owlfolio dot org> ---
It's come to my attention that people fairly often write `sizeof('x')` (or some
other character constant), _expecting_ it to evaluate as `sizeof(char)`.  But
this is only true in C++. In C, `sizeof('x')` evaluates as `sizeof(int)`.

See
http://codesearch.debian.net/search?q=filetype%3Ac+%5Cbsizeof%5Cs*%5C%28%5Cs*%27&literal=0
for many examples.

It's probably more important to warn about this than about `sizeof(char)`
itself.

Reply via email to