#109 sdcc could not compile reentrant _atoi.c

closed-fixed
2
2013-05-25
2001-08-13
Anonymous
No

I issued the following command in the

sdcc --stack-auto -c _atoi.c

and got the following error message:

0 [main] sdcc 364 open_stackdumpfile: Dumping stack
trace to sdcc.exe.stackdump
Segmentation fault (core dumped)

The same occur with other files and the problem
in the _atoi.c is the line:

rv = (rv * 10) + (*s - '0');

more precisily the espression (rv * 10).

Attached is the core file.

Regards,

Martin Loebmann (loebmann@yahoo.com)

Just for sure, the _atoi.c is below:

int atoi(char * s)
{
register int rv=0;
register char sign = 0;

while (*s) {
if (*s <= '9' && *s >= '0')
break;
if (*s == '-' || *s == '+')
break;
s++;
}

sign = (*s == '-');
if (*s == '-' || *s == '+') s++;

while (*s && *s >= '0' && *s <= '9') {
rv = (rv * 10) + (*s - '0');
s++;
}

return (sign ? -rv : rv);
}

Discussion

  • Johan Knol

    Johan Knol - 2001-08-23
    • assigned_to: nobody --> johanknol
    • priority: 5 --> 2
    • status: open --> open-fixed
     
  • Johan Knol

    Johan Knol - 2001-08-31
    • assigned_to: johanknol --> nobody
     
  • Johan Knol

    Johan Knol - 2001-09-03
    • assigned_to: nobody --> johanknol
    • milestone: 100454 --> fixed
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks