bugAVR C Runtime Library - Bugs: bug #14503, strnlen_P is wrong with classic...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #14503: strnlen_P is wrong with classic AVRs

Submitter:  None
Submitted:  Sun 11 Sep 2005 09:28:47 PM UTC
   
 
Category:  Library Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Percent Complete:  0% Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  None
Fixed Release:  None

Mon 26 Sep 2005 05:33:58 PM UTC, comment #1: 

Fixed 2005-09-26.

Thanks Dmitry.

Anatoly Sokolov <aesok>
Group administrator
Sun 11 Sep 2005 09:28:47 PM UTC, original submission:  

strnlen_P is not work correctly for classic AVR-s. The reason
is next: macro 'LPM_R0_ZP' inserts 'adiw' instruction, which destroyed
a 'C' flag.
   Next program illustrates an error, if compiled for AT90S8515
chip:

   #include <avr/pgmspace.h>
   _attribute_((progmem)) char s[] = "12345";
   int main ()
   {
       return (strnlen_P(s,1) == 1) ? 0 : 1;
   }

It is possible to correct this error by moving LPM_R0_ZP before
the subi/sbci pair. Patch is present.

Dmitry.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #3250:  strnlen_P.patch added by None (325B - text/x-diff - Patch for 'strnlen_P.S' .)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-09-26 aesok StatusNone Fixed
    Open/ClosedOpen Closed
2005-09-11 None Attached File- Added strnlen_P.patch, #2943
    Carbon-Copy- Added dmixm --СБК-- marine --ТЧК-- febras --ТЧК-- ru

Back to the top

Powered by Savane 3.13-d3ae.
Corresponding source code