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

 
 

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

Submitted by:  None
Submitted on:  Fri 28 Sep 2007 02:57:12 PM UTC  
 
Category: DocumentationSeverity: 3 - Normal
Priority: 7 - HighItem Group: None
Status: FixedPercent Complete: 100%
Assigned to: Eric Weddington <arcanum>Originator Email: -unavailable-
Open/Closed: ClosedRelease: None
Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 02 Oct 2007 09:57:14 PM UTCarcanumStatusNone=>Fixed
    Tue 02 Oct 2007 09:56:10 PM UTCarcanumPercent Complete0%=>100%
      Open/ClosedOpen=>Closed
    Fri 28 Sep 2007 06:35:10 PM UTCarcanumPriority5 - Normal=>7 - High
      Assigned toNone=>arcanum

    Back to the top


    Powered by Savane 3.1-cleanup1