bugAVR C Runtime Library - Bugs: bug #21183, Bug in Chapter "Data in...

 
 

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

bug #21183: Bug in Chapter "Data in Program Space"

Submitter:  None
Submitted:  Fri 28 Sep 2007 02:57:12 PM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Priority:  7 - High Item Group:  None
Status:  Fixed Assigned to:  arcanum
Percent Complete:  100% Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  None
Fixed Release:  None

Fri 28 Sep 2007 02:57:12 PM UTC, original submission:  

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.



Anonymous

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by arcanum (Updated the item)
  •  

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-10-02 arcanum StatusNone Fixed
    2007-10-02 arcanum Percent Complete0% 100%
        Open/ClosedOpen Closed
    2007-09-28 arcanum Priority5 - Normal 7 - High
        Assigned toNone arcanum

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code