[Coco] Fwd: MW-C Cross compiler bug - Solved

Luis Antoniosi (CoCoDemus) retrocanada76 at gmail.com
Sun Mar 9 17:54:44 EDT 2014


Still not working for me. With your modification it seems to break the
comment strip out. Try to include stdio.h

This is what I get from coprep:

#7
vdped.ns
vdped_ns
#P
vdped_ns
0
#7
/dd/defs/stdio.h
stdio_h
#5
0
#5
2
typedef struct _iobuf {
char * _ptr ,  ter * / r * /
* _base ,   address * / /
* _end ;   address * / /
int _flag ;  tus * / us * /
int _fd ;  ber * / / ber * /
char _save ;  red * / d * /
int _bufsiz ;  fer * / * /
} FILE ;

BTW: I'm using linux 64-bit.

On Sun, Mar 9, 2014 at 1:04 PM, Jamie Cho <silurian at icloud.com> wrote:
> I tracked the error down to the space() function in cprep19. Basically, it is no longer legal for strcpy() or memcpy() to be sent overlapping arrays, but it is ok with memmove().
>
> The corrected version looks like:
> int
> space (                         /* shrink spaces to one */
>         int a, int b)
> {
>   register char *cptr;
>   char *bptr;
>   size_t line_size;
>
>   bptr = cptr = &line[b];
>
>   while (*(++cptr) == ' ');
>
>   if (bptr != cptr - 1)
>   {
>       line_size = strlen(cptr);
>       memmove(bptr + 1, cptr, line_size);
>       a -= (cptr - bptr - 1);
>   }
>
>   return a;
> }
>
> Who is the maintainer of the compiler and where should updates be posted?
>
> Best,
> Jamie
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco



-- 
Long live the CoCo



More information about the Coco mailing list