This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug driver/10961] read_specs -- compilers[n_compilers].cpp_spec not initialized
- From: "tromey at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jan 2007 18:39:20 -0000
- Subject: [Bug driver/10961] read_specs -- compilers[n_compilers].cpp_spec not initialized
- References: <bug-10961-6090@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from tromey at gcc dot gnu dot org 2007-01-17 18:39 -------
I read through the existing code here and I think it is subtly correct.
The default_compilers array has a final entry consisting of all zeroes:
/* Mark end of table. */
{0, 0, 0, 0, 0}
'compilers' is initially a copy of this table. So, the last entry in
compilers is all zeroes.
The code quoted in the PR is reallocating the compilers array. It sets
some fields in the final entry -- but not all fields. However, this is ok
since we know those to be zero. Then this code memset()s the new
terminating entry to be all zeroes. This lets us conclude that this
code is safe, by induction.
So, I am closing this PR as invalid. If you believe this analysis is
in error, please reopen the PR and explain how. I will provide a patch
in this case.
--
tromey at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at gcc dot gnu dot
| |org
Status|NEW |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10961