This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 0/6] improve handling of char arrays with missing nul (PR 86552, 86711, 86714)
- From: Jeff Law <law at redhat dot com>
- To: Martin Sebor <msebor at gmail dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 15 Aug 2018 00:02:09 -0600
- Subject: Re: [PATCH 0/6] improve handling of char arrays with missing nul (PR 86552, 86711, 86714)
- References: <email@example.com> <firstname.lastname@example.org> <email@example.com>
On 08/13/2018 03:23 PM, Martin Sebor wrote:
> To make reviewing the changes easier I've split up the patch
> into a series:
[ ... ]
I'm about done for the night and thus won't get into the series (and as
you know Bernd has a competing patch in this space). But I did want to
chime in on two things...
> There are many more string functions where unterminated (constant
> or otherwise) should be diagnosed. I plan to continue to work on
> those (with the constant ones first) but I want to post this
> updated patch for review now, mainly so that the wrong code bug
> (PR 86711) can be resolved and the basic detection infrastructure
> agreed on.
Yes, I think we definitely want to focus on the wrong code bug first.
> An open question in my mind is what should GCC do with such calls
> after issuing a warning: replace them with traps? Fold them into
> constants? Or continue to pass them through to the corresponding
> library functions?
My personal preference is to turn them into traps. I don't think we
have to preserve the call itself in this case. I think the sequencing
is to insert the trap before the call point, split the block after the
trap, remove the outgoing edges, let DCE clean up the rest. At least I
think that's the sequencing.