The gcc in svn issues errors when variables are non-const and declared
in progmem.  This caused avr-libc to fail to build but it was very easy
to fix, I attached a patch.

Sean
Index: include/avr/pgmspace.h
===================================================================
RCS file: /sources/avr-libc/avr-libc/include/avr/pgmspace.h,v
retrieving revision 1.45
diff -u -r1.45 pgmspace.h
--- include/avr/pgmspace.h	15 Nov 2009 06:30:23 -0000	1.45
+++ include/avr/pgmspace.h	25 Nov 2011 05:49:51 -0000
@@ -246,7 +246,7 @@
 # define PSTR(s) ((const PROGMEM char *)(s))
 #else  /* !DOXYGEN */
 /* The real thing. */
-# define PSTR(s) (__extension__({static char __c[] PROGMEM = (s); &__c[0];}))
+# define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
 #endif /* DOXYGEN */
 
 #define __LPM_classic__(addr)   \
Index: libc/stdlib/dtostre.c
===================================================================
RCS file: /sources/avr-libc/avr-libc/libc/stdlib/dtostre.c,v
retrieving revision 1.3
diff -u -r1.3 dtostre.c
--- libc/stdlib/dtostre.c	1 Apr 2009 23:10:59 -0000	1.3
+++ libc/stdlib/dtostre.c	25 Nov 2011 05:49:52 -0000
@@ -37,19 +37,20 @@
 char *
 dtostre (double val, char *sbeg, unsigned char prec, unsigned char flags)
 {
-    __attribute__((progmem)) static char str_nan[2][4] =
+    __attribute__((progmem)) static const char str_nan[2][4] =
 	{"nan", "NAN"};
-    __attribute__((progmem)) static char str_inf[2][sizeof(str_nan[0])] =
+    __attribute__((progmem)) static const char str_inf[2][sizeof(str_nan[0])] =
 	{"inf", "INF"};
     char *d;		/* dst	*/
-    char *s;		/* src	*/
+    const char *s;	/* src	*/
     signed char exp;
     unsigned char vtype;
 
     if (prec > 7) prec = 7;
     
     exp = __ftoa_engine (val, sbeg, prec, 0);
-    d = s = sbeg;
+    s = sbeg;
+    d = (char*)s;
     vtype = *s++;
 
     if ((vtype & FTOA_MINUS) && !(vtype & FTOA_NAN))	/* like 'Glibc'	*/
_______________________________________________
AVR-libc-dev mailing list
AVR-libc-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to