Time.h and arduino-mk

I'm using arduino-mk to compile my sketch, but i noticed it is a bit more strict then the IDE compiler. I managed to get some problems fixed, but now I stumble upon a message from the Time.h library. The error I get:

/usr/bin/avr-gcc -MMD -c -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/mega -I/usr/share/arduino/libraries/Time -I/usr/share/arduino/libraries/Ethernet -I/usr/share/arduino/libraries/SPI -I/usr/share/arduino/libraries/Ethernet/utility  -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions   /usr/share/arduino/libraries/Time/DateStrings.cpp -o build-mega2560/libs/Time/DateStrings.o
In file included from /usr/share/arduino/libraries/Time/DateStrings.cpp:11:0:
/usr/share/arduino/libraries/Time/DateStrings.cpp:41:22: error: variable ‘monthNames_P’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
 PGM_P monthNames_P[] PROGMEM =
                      ^
/usr/share/arduino/libraries/Time/DateStrings.cpp:58:20: error: variable ‘dayNames_P’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
 PGM_P dayNames_P[] PROGMEM = { dayStr0,dayStr1,dayStr2,dayStr3,dayStr4,dayStr5,dayStr6,dayStr7};
                    ^
/usr/share/arduino/libraries/Time/DateStrings.cpp:59:24: error: variable ‘dayShortNames_P’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
 char dayShortNames_P[] PROGMEM = "ErrSunMonTueWedThrFriSat";
                        ^
make: *** [build-mega2560/libs/Time/DateStrings.o] Error 1

I check all the variables, and I think they already are defined as constants. So I don't really know what the problem is.

I found somthing with avrgcc 4.7.1 being different, so my version is 4.8.2 (RaspBian Jessie)

I check all the variables, and I think they already are defined as constants.

Where so you see const anywhere:

char monthStr1[] PROGMEM = "January";
char monthStr2[] PROGMEM = "February";
char monthStr3[] PROGMEM = "March";
char monthStr4[] PROGMEM = "April";
char monthStr5[] PROGMEM = "May";
char monthStr6[] PROGMEM = "June";
char monthStr7[] PROGMEM = "July";
char monthStr8[] PROGMEM = "August";
char monthStr9[] PROGMEM = "September";
char monthStr10[] PROGMEM = "October";
char monthStr11[] PROGMEM = "November";
char monthStr12[] PROGMEM = "December";

over here:

const char monthStr1[] PROGMEM = "January";
const char monthStr2[] PROGMEM = "February";
const char monthStr3[] PROGMEM = "March";
const char monthStr4[] PROGMEM = "April";
const char monthStr5[] PROGMEM = "May";
const char monthStr6[] PROGMEM = "June";
const char monthStr7[] PROGMEM = "July";
const char monthStr8[] PROGMEM = "August";
const char monthStr9[] PROGMEM = "September";
const char monthStr10[] PROGMEM = "October";
const char monthStr11[] PROGMEM = "November";
const char monthStr12[] PROGMEM = "December";

PGM_P monthNames_P[] PROGMEM =
{
    "",monthStr1,monthStr2,monthStr3,monthStr4,monthStr5,monthStr6,
        monthStr7,monthStr8,monthStr9,monthStr10,monthStr11,monthStr12
};

const char monthShortNames_P[] PROGMEM = "ErrJanFebMarAprMayJunJulAugSepOctNovDec";

const char dayStr0[] PROGMEM = "Err";
const char dayStr1[] PROGMEM = "Sunday";
const char dayStr2[] PROGMEM = "Monday";
const char dayStr3[] PROGMEM = "Tuesday";
const char dayStr4[] PROGMEM = "Wednesday";
const char dayStr5[] PROGMEM = "Thursday";
const char dayStr6[] PROGMEM = "Friday";
const char dayStr7[] PROGMEM = "Saturday";

PGM_P dayNames_P[] PROGMEM = { dayStr0,dayStr1,dayStr2,dayStr3,dayStr4,dayStr5,dayStr6,dayStr7};

I downloaded the latest version: Time Library, Timekeeping and Time/Date Manipulation on Teensy

I found the answer.

http://forum.arduino.cc/index.php?action=profile;u=152505;sa=showPosts

It's from 2012!!!

Strange, I have two computers running Lubuntu, the pc desktop installed the library and works normal, but the notebook recently upgraded to 13, the error of the variable.
I copied the files that works and even then the error in notebook

I can not recreate the process. I tried various versions and does not work

The code was obviously written by someone who dislikes the idea that C/C++ arrays start from zero. Probably a fortran programmer.

@ Minchinion...
+1 A good lesson for those of us that believe we know better...

Doc