[En-Nut-Discussion] Putting strings etc transparent into PROGMEM

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Fri Oct 23 12:55:42 CEST 2009


>>>>> "Harald" == Harald Kipp <harald.kipp at egnite.de> writes:

    Harald> Hi Uwe, Uwe Bonnes wrote:

    >> +#ifdef PROGMEM +static CONST char os_version_string[] PROGMEM +#else
    >> +static CONST char os_version_string[] +#endif + = "4.9.7.0";

    Harald> The #ifs are not required, because non-Harvard architectures
    Harald> provide a PROGMEM dummy.


    >> Would this be transparent for a usage like ./nut/pro/httpd.c:
    >> fprintf_P(stream, fmt_P, HTTP_MAJOR_VERSION, HTTP_MINOR_VERSION,
    >> status, title, NutVersionString());

    Harald> It would be incompatible, because %P is required instead of
    Harald> %s. This would break a large number of applications, just to
    Harald> save 8 bytes of RAM.

Do non-Harvard architectures provide a dummy %P?
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



More information about the En-Nut-Discussion mailing list