bugAVR C Runtime Library - Bugs: bug #36933, Documentation no longer correctly...

 
 

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

bug #36933: Documentation no longer correctly describes how to declare strings for storage in program memory

Submitter:  Stuart Cording <codinghead>
Submitted:  Tue 24 Jul 2012 09:44:17 AM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Priority:  9 - Immediate Item Group:  Documentation
Status:  Confirmed Assigned to:  elderling
Percent Complete:  100% Open/Closed:  Closed
Release:  2.0.0 Fixed Release:  None

Thu 11 Aug 2016 09:01:39 AM UTC, comment #1: 

Why is this bug still "open" ?
avr-libc 2.0.0 doc still unpatched!


jens harms <jens70>
Tue 24 Jul 2012 09:44:17 AM UTC, original submission:  

The documentation page as described below no longer correctly describes how to define strings that are to be stored in program memory using the PGM_P and PROGMEM definition s.

This issue occurs when moving from version 1.7.1 to 1.8.0.

Description of the issue with the 1.8.0 library and how to solve it below.

> The strings were defined as per the AVR Libc homepage -
> http://www.nongnu.org/avr-libc/user-manual/pgmspace.html
>
> They suggest:
> char string_1[] PROGMEM = "String 1";
> char string_2[] PROGMEM = "String 2";
> char string_3[] PROGMEM = "String 3";
> char string_4[] PROGMEM = "String 4";
> char string_5[] PROGMEM = "String 5";
>
> PGM_P string_table[] PROGMEM =
> {
>     string_1,
>     string_2,
>     string_3,
>     string_4,
>     string_5
> };
>
> However, on compiling my code I received the following error for each such defined line of code:
>
> Error 1 variable 'string_B01' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
>
> Changing the code to the following resolves the issue:
>
> const char string_1[] PROGMEM = "String 1"; const char string_2[]
> PROGMEM = "String 2"; const char string_3[] PROGMEM = "String 3";
> const char string_4[] PROGMEM = "String 4"; const char string_5[]
> PROGMEM = "String 5";
>
> PGM_P const string_table[] PROGMEM =
> {
>     string_1,
>     string_2,
>     string_3,
>     string_4,
>     string_5
> };


Stuart Cording <codinghead>

 

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

Attached Files
file #27591:  36933.patch added by aurel32 (2KiB - text/x-diff - Patch to fix the documentation)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by elderling (Updated the item)
  • -email is unavailable- added by jens70 (Posted a comment)
  • -email is unavailable- added by aurel32 (Updated the item)
  • -email is unavailable- added by arcanum (Updated the item)
  • -email is unavailable- added by codinghead (Submitted the item)
  •  

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-08-14 elderling Percent Complete80% 100%
        Open/ClosedOpen Closed
    2016-08-12 elderling Percent Complete0% 80%
    2016-08-12 elderling StatusNone Confirmed
    2016-08-12 elderling Release1.8.0 2.0.0
    2016-08-12 elderling Assigned toNone elderling
    2013-03-10 aurel32 Attached File- Added 36933.patch, #27591
    2012-11-16 arcanum Priority5 - Normal 9 - Immediate

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code