[Bug c/44179] warn about sizeof(char) and sizeof('x')

2023-12-16 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44179 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org --- Comm

[Bug c/44179] warn about sizeof(char) and sizeof('x')

2023-12-16 Thread harald at gigawatt dot nl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44179 Harald van Dijk changed: What|Removed |Added CC||harald at gigawatt dot nl --- Comment

[Bug c/44179] warn about sizeof(char) and sizeof('x')

2023-12-15 Thread zack+srcbugz at owlfolio dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44179 --- Comment #3 from Zack Weinberg --- 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')` eval

[Bug c/44179] warn about sizeof(char)

2010-05-17 Thread zackw at panix dot com
--- Comment #2 from zackw at panix dot com 2010-05-17 23:59 --- So it has to be a little smarter than the obvious, so what else is new. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44179

[Bug c/44179] warn about sizeof(char)

2010-05-17 Thread pinskia at gcc dot gnu dot org
--- Comment #1 from pinskia at gcc dot gnu dot org 2010-05-17 22:10 --- I can see a case involving templates or macros where the warning does not make sense and involving the new C1x/C++0x static_assert too. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44179