[Coco] Fwd: MW-C Cross compiler bug - Solved
Luis Antoniosi (CoCoDemus)
retrocanada76 at gmail.com
Sun Mar 9 17:59:03 EDT 2014
I got the problem you forgot to move the trailing NULL:
line_size = strlen(cptr);
memmove(bptr + 1, cptr, line_size + 1);
now it's compiling thanks.
But it seems to have some bug with long math. I'll try to isolate the problem.
On Sun, Mar 9, 2014 at 5:54 PM, Luis Antoniosi (CoCoDemus)
<retrocanada76 at gmail.com> wrote:
> 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
--
Long live the CoCo
More information about the Coco
mailing list