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

Siddhesh Poyarekar siddhesh@sourceware.org
Thu Mar 15 07:15:00 GMT 2018


On Wednesday 14 March 2018 08:40 PM, Richard Biener wrote:
> Instead of building a tree from max you should use
> 
>     if (wi::to_widest (max) < wi::to_widest (wi::to_wide (dstsize)))
>       return;
> 
> given compute_objsize is somewhat confused about the type it returns
> a widest_int compare is required.
> 
> Note I'm not too familiar with tree-ssa-strlen.c nor this part of the
> warning code
> so I'll not approve the patch but after fixing that it looks techincally ok.

Thanks, I'll post a fixed up version soon.

Siddhesh



More information about the Gcc-patches mailing list