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 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


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