Forum: Compiler & IDEs avr-libc Fehlermeldung beim compilen


von Simon (Gast)


Lesenswert?

$ ./configure --prefix=$PREFIX --build=`./config.guess` --host=avr
$ make


avr-gcc -DHAVE_CONFIG_H -I. -I../../..  -I../../../common 
-I../../../include -I../../../include  -g -Wall -W -Wstrict-prototypes 
-mmcu=avr2 -D__COMPILING_AVR_LIBC__ -mcall-prologues -Os  -MT dtostre.o 
-MD -MP -MF .deps/dtostre.Tpo -c -o dtostre.o 
../../../libc/stdlib/dtostre.c
../../../libc/stdlib/dtostre.c: In function 'dtostre':

../../../libc/stdlib/dtostre.c:40:42: error: variable 'str_nan' must be 
const in order to be put into read-only section by means of 
'__attribute__((progmem))'

../../../libc/stdlib/dtostre.c:42:42: error: variable 'str_inf' must be 
const in order to be put into read-only section by means of 
'__attribute__((progmem))'
make[5]: *** [dtostre.o] Error 1

von Klaus W. (mfgkw)


Lesenswert?

Dann mach sie halt const, oder wo ist die Frage?

von Simon (Gast)


Lesenswert?

Wie macht man das?
Ich wollte ansich nur avr-gcc compilen

von Simon (Gast)


Lesenswert?

Ich kann hier aus static const machen, kein thema, aber ob das nicht 
auswirkungen hat? am ende funzt nix mehr und es libt an der libc selbst

    __attribute__((progmem)) static char str_nan[2][4] =
        {"nan", "NAN"};
    __attribute__((progmem)) static char str_inf[2][sizeof(str_nan[0])] 
=
        {"inf", "INF"};

von Simon (Gast)


Lesenswert?

include/avr/pgmspace.h
Zeile 255 die PSTR definition war auch static und nicht const.

Compiled nun wunderbar

von Johann L. (gjlayde) Benutzerseite


Lesenswert?

Simon schrieb:
> Ich wollte ansich nur avr-gcc compilen

Offenbar nicht, du compilierst avr-libc ;-)

https://savannah.nongnu.org/bugs/?32988

> Ich kann hier aus static const machen, ...

Nein! Du machst aus "static" ein "static const". Es sind 2 oder 3 
Stellen const zu machenen, also nicht static durch const ersetzen.

Hier die notwendigen Änderungen:
   http://svn.savannah.nongnu.org/viewvc?view=rev&root=avr-libc&revision=2239
   http://svn.savannah.nongnu.org/viewvc?view=rev&root=avr-libc&revision=2241

Alternativ die aktuellen abr-libc Quellen verwenden, d.h. direkt auf dem 
CVS.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.