diff options
author | Marek Polacek <polacek@redhat.com> | 2022-03-30 16:59:33 -0400 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2022-05-04 16:10:09 -0400 |
commit | 1cd3faf5dddb3cbfa2ed308ecf3db4f70bff337e (patch) | |
tree | 1342bb9e55c0fdfc47b5370c4af01ed3ffb566ee /libcpp/system.h | |
parent | a733dea9e7c39352ce9f72059938833eaa819467 (diff) | |
download | gcc-1cd3faf5dddb3cbfa2ed308ecf3db4f70bff337e.zip gcc-1cd3faf5dddb3cbfa2ed308ecf3db4f70bff337e.tar.gz gcc-1cd3faf5dddb3cbfa2ed308ecf3db4f70bff337e.tar.bz2 |
c-family: Tweak -Woverflow diagnostic
When g++ emits
warning: overflow in conversion from 'int' to 'char' changes value from '300' to '',''
for code like "char c = 300;" it might raise a few eyebrows. With this
warning we're not interested in the ASCII representation of the char, only
the numerical value, so convert constants of type char to int. It looks
like this conversion only needs to be done for char_type_node.
gcc/c-family/ChangeLog:
* c-warn.cc (warnings_for_convert_and_check): Convert constants of type
char to int.
gcc/testsuite/ChangeLog:
* c-c++-common/Wconversion-1.c: New test.
Diffstat (limited to 'libcpp/system.h')
0 files changed, 0 insertions, 0 deletions