avr-libc-dev
[Top][All Lists]
Advanced

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

[avr-libc-dev] [bug #21183] Bug in Chapter "Data in Program Space"


From: anonymous
Subject: [avr-libc-dev] [bug #21183] Bug in Chapter "Data in Program Space"
Date: Fri, 28 Sep 2007 14:57:14 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20061201 Firefox/2.0.0.6 (Ubuntu-feisty)

URL:
  <http://savannah.nongnu.org/bugs/?21183>

                 Summary: Bug in Chapter "Data in Program Space"
                 Project: AVR C Runtime Library
            Submitted by: None
            Submitted on: Freitag 28.09.2007 um 14:57 UTC
                Category: Documentation
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
        Percent Complete: 0%
             Assigned to: None
        Originator Email: AndyP
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

In "Storing and Retrieving Strings in the Program Space" you'll find the
following line in an example:

strcpy_P(buffer, pgm_read_word(&(string_table[i])));

This leads to a compiler warning and non-working code:

test0.c:26: warning: passing argument 2 of 'strcpy_P' makes pointer from
integer without a cast

Correct code line would be:

strcpy_P(buffer, (PGM_P) pgm_read_word (string_table+i)); 

or proposed by Joerg Wunsch in a german forum:

strcpy_P(buffer, (PGM_P)pgm_read_word(&(string_table[i])));

Regards,
AndyP.







    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?21183>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

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