[PATCH] Fix bogus strncpy source length warning on source bound by constant

Siddhesh Poyarekar siddhesh@sourceware.org
Tue Mar 13 09:02:00 GMT 2018


On Monday 12 March 2018 03:26 PM, Richard Biener wrote:
> Please use tree_int_cst_lt (rhs1, dstsize) instead.
> 
>> +           {
>> +             gimple_set_no_warning (stmt, true);
> 
> Why this?  There's only a single bit -- where do we warn from if you
> don't do this here?

I incorrectly thought it was necessary to set that flag but I noticed
now that it isn't.  I'll remove it.

> I also wonder why this code doesn't use range-info given the
> INTEGER_CST constraints
> range-info should tell us more than just handling MIN_EXPR?

Right, I'll try using range-info.

Thanks,
Siddhesh



More information about the Gcc-patches mailing list