This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Revised stack alignment change, part 2/3
- To: Daniel Berlin <dan at www dot cgsoftware dot com>
- Subject: Re: [PATCH]: Revised stack alignment change, part 2/3
- From: Graham Stott <grahams at redhat dot com>
- Date: Fri, 05 Jan 2001 17:51:13 +0000
- Cc: gcc-patches at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10101051227460.26222-100000@www.cgsoftware.com>
Daniel Berlin wrote:
>
> + static char *
> + build_aligned_name (name)
> + const char *name;
> + {
> + /* FIXME: use ggc_alloc_string properly */
> + char *aligned_name = xmalloc(strlen(name) + 9);
> +
> + strcpy (aligned_name, name);
> + strcat (aligned_name, ".aligned");
> + return aligned_name;
> + }
> +
Why don't you fix the FIXME something alomg the
lines of the following should work.
static cont char *
build_aligned_name (name)
const char *name;
{
size_t len = strlen (name) + 9
char *aligned_name = (char *)alloca (len);
strcpy (aligned_name, name);
strcat (aligned_name, ".aligned");
return ggc_alloc_string (aligned_name, len);
}
Graham