[PATCH] c-family: ICE with -Wconversion and A ?: B [PR101030]

Jason Merrill jason@redhat.com
Wed Mar 30 02:23:56 GMT 2022


On 3/29/22 16:59, Marek Polacek wrote:
> On Tue, Mar 29, 2022 at 04:53:21PM -0400, Marek Polacek via Gcc-patches wrote:
>> This patch fixes a crash in conversion_warning on a null expression.
>> It is null because the testcase uses the GNU A ?: B extension.  We
>> could also use op0 instead of op1 in this case, but it doesn't seem
>> to be necessary.
> 
> A related issue: we print
> warning: overflow in conversion from 'int' to 'char' changes value from '300' to '',''
> in the test in the patch.  That's because the value is 44, it's type is char,
> and the ASCII value for ',' is 44.  So I think we should convert values of char
> type to int for the diagnostic.

Sure.



More information about the Gcc-patches mailing list