This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Trivial C++ PATCH to cp_fname_init
> I think it was unnecessary. build_string allocates space for the
> terminating '\0' already, so build_string (strlen (str), str) is the
> correct way of building a STRING_CST.
That's right. Browsing the tree is pretty confusing because you have both
versions, e.g. in builtins.c
tree_cons (NULL, build_string (6, "memory"), NULL));
and in ipa-reference.c
build_string(7, "memory");
But some time ago I tried to clean this up and tested a seemingly trivial
patch... which didn't even bootstrap, so there might be hidden subtleties.
--
Eric Botcazou