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: GCC build failed for native with your patch on 2003-10-06T06:15:01Z.


Andrew Pinski <pinskia@physics.uc.edu> writes:

> Lets try this again (one more off by one error):
> Index: config/darwin.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/config/darwin.c,v
> retrieving revision 1.48
> diff -u -p -r1.48 darwin.c
> --- config/darwin.c     6 Oct 2003 06:11:14 -0000       1.48
> +++ config/darwin.c     6 Oct 2003 06:35:10 -0000
> @@ -391,12 +391,12 @@ machopic_stub_name (const char *name)
> 
>       if (needs_quotes)
>         {
> -        memcpy (buffer + bufferlen +1, "$stub\"", strlen("$stub\""));
> +        memcpy (buffer + bufferlen +1, "$stub\"", strlen("$stub\"")+1);
>           bufferlen += strlen("$stub\"");
>         }
>       else
>         {
> -        memcpy (buffer + bufferlen +1, "$stub", strlen("$stub"));
> +        memcpy (buffer + bufferlen +1, "$stub", strlen("$stub")+1);
>           bufferlen += strlen("$stub");
>         }
>       ptr_name = get_identifier (buffer);

This is OK, but the coding conventions say you should write it as

memcpy (buffer + bufferlen + 1, "$stub\"", strlen("$stub\"") + 1);

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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