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/



_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to