[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Broken strtoul() and ldiv()

From: Geoffrey Wossum
Subject: Re: [avr-gcc-list] Broken strtoul() and ldiv()
Date: Sun, 10 Mar 2002 19:57:02 -0600 (CST)

> I have seen this too, but have not had a need to fix it, do you have a
> fix for avr-libc or gcc-3.0.4?

Well, the easy fix is just to put the conditionals so that it uses '/' and
'%' instead of ldiv().  That works great.  If that's the solution we want
to go with, then I can make a patch that fixes that.  However, I
understand that the code is using ldiv() instead for efficiency purposes.
Also, I assume ldiv() is broken, although I haven't tested ldiv() by
itself, so maybe ldiv() is only broken within strtoul().  That doesn't
really make sense, but I've seen weirder things.

As far as fixing ldiv(), I don't know if the avr-libc is calling the
incorrect function in libgcc, or calling it wrong.  If avr-libc is
correct, then libgcc is the broken one.  My knowlege of AVR assembler and
libgcc is insufficient for me to know which is the case.  I haven't looked
at the libgcc source yet.

BTW, I was having the problem with an ATmega103, if that makes any
difference.  My coworker says he also has the problem with the ATmega128.
I think I left this out of my original post.

Geoffrey Wossum
Project AKO - http://ako.sf.net

avr-gcc-list at http://avr1.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]