Handle -Wsign-conversion in conversion_warning.
authorJason Merrill <jason@redhat.com>
Fri, 10 Jan 2020 17:49:03 +0000 (12:49 -0500)
committerJason Merrill <jason@redhat.com>
Tue, 21 Jan 2020 23:40:19 +0000 (18:40 -0500)
commit731dbfc3f3b586e78f2ccdca24561ea3369c6338
tree09c32959a13bc55ae6e02299dbec36f1b85d56ca
parent0501b74264e93bf9ebf45cf10a624a549dc474f1
Handle -Wsign-conversion in conversion_warning.

It seemed strange to me to warn about sign conversion in
unsafe_conversion_p, when other warnings are in conversion_warning, and the
latter function is the only place that asks the former function to warn.
This change is also necessary for my -Warith-conversion patch.

* c-common.c (unsafe_conversion_p): Don't warn, return UNSAFE_SIGN.
* c-warn.c (conversion_warning): Warn about UNSAFE_SIGN.
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c-family/c-warn.c