This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]