This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2] Fix bogus strncpy source length warning on source bound by constant
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