AVR-GCC Bug about atol()

Feb 01, 2005 2 Replies

Hi,



I find a bug in avr-gcc library. When the following code is compiled, the avr-objcopy.exe has problem and exit. The compilation information has the following information:



Converting to AVR Extended COFF: main.cof avr-objcopy --debugging --change-section-address .data-0x800000



--change-section-address .bss-0x800000 --change-section-address .noinit-0x800000 --change-section-address .eeprom-0x810000 -O coff-ext-avr main.elf main.cof make.exe: *** [extcoff] Error -1073741819



And there is no problem when I changed atol() to atoi().



Code:



: : a[len]=0; getProductInfo(atol(a)); //getProductInfo(atoi(a)); : :



... snip ...

That is not exactly a compilable program, and you don't show getProductInfo. However, atol returns a long, while atoi returns an int. One of these must be the wrong type to supply to GetProductInfo. Turn up the compiler warning level.

"If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required