[Top][All Lists]

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

[avr-libc-dev] [bug #14503] strnlen_P is wrong with classic AVRs

From: anonymous
Subject: [avr-libc-dev] [bug #14503] strnlen_P is wrong with classic AVRs
Date: Sun, 11 Sep 2005 21:28:48 +0000


                 Summary: strnlen_P is wrong with classic AVRs
                 Project: AVR C Runtime Library
            Submitted by: None
            Submitted on: Вск 11.09.2005 at 21:28
                Category: Library
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
        Percent Complete: 0%
        Originator Email: address@hidden
             Open/Closed: Open



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

   #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.



Carbon-Copy List:

CC Address                          | Comment
dmixm --СБК-- marine --ТЧК-- febras --ТЧК-- ru | Originator Email


File Attachments:

Date: Вск 11.09.2005 at 21:28  Name: strnlen_P.patch  Size: 325B   By:
Patch for 'strnlen_P.S' .


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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