user57281: I'm using DS3231 module with rinkydink library and it is working just fine, however every time i want to compile the code Arduino IDE shows this warning:
C:\Program Files (x86)\Arduino\libraries\DS3231\DS3231.cpp:291:106:
warning: ISO C++ forbids converting a string constant to 'char*'
[-Wwrite-strings]

What is this warning and how to solve it?

user49991: The DS3231 library from Rinky Dink is the best RTC library there is...I know, I tried them ALL.  This library allows one to print date and time strings with only 3 Arduino print statements:  Serial.print(rtc.getDateStr());
      Serial.print(" -- ");
      Serial.println(rtc.getTimeStr());
Other RTC libraries force user to make the strings up themselves, at a cost of about 12 lines of useless Serial.print commands.

user7508: The warning was caused by this line:
char *monthShort[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};

In C++, the content of a character string such as "Jan" cannot be
modified. Thus, if you assign the string to a pointer, the pointer
should be declared as const char *:
const char *monthShort[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
                            "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};

The same applies to the other arrays of strings: daysLong, daysShort
and monthLong. As a consequence, the prototypes of the methods
getDOWStr() and getMonthStr() should be changed in order to return a
const char *.
BTW, are you sure this library is still maintained? This should have
been fixed a long time ago, and it seems the source was last modified in
2015. You may be better off using a more modern alternative. For
instance, in the Arduino library manager, you can find DS3231 and
Adafruit's RTClib.

57281: <p>I'm using <a href="https://datasheets.maximintegrated.com/en/ds/DS3231.pdf" rel="nofollow noreferrer">DS3231 module</a> with <a href="http://www.rinkydinkelectronics.com/library.php?id=73" rel="nofollow noreferrer">rinkydink library</a> and it is working just fine, however every time i want to compile the code Arduino IDE shows this warning:</p>
<pre><code>C:\Program Files (x86)\Arduino\libraries\DS3231\DS3231.cpp:291:106:
warning: ISO C++ forbids converting a string constant to 'char*'
[-Wwrite-strings]
</code></pre>
<p>What is this warning and how to solve it?</p>
 49991: <p>The DS3231 library from Rinky Dink is the best RTC library there is...I know, I tried them ALL.  This library allows one to print date and time strings with only 3 Arduino print statements:  Serial.print(rtc.getDateStr());
      Serial.print(" -- ");
      Serial.println(rtc.getTimeStr());
Other RTC libraries force user to make the strings up themselves, at a cost of about 12 lines of useless Serial.print commands.</p>
 7508: <p>The warning was caused by this line:</p>

<pre class="lang-cpp prettyprint-override"><code>char *monthShort[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
</code></pre>

<p>In C++, the content of a character string such as <code>"Jan"</code> cannot be
modified. Thus, if you assign the string to a pointer, the pointer
should be declared as <strong>const</strong>&nbsp;char&nbsp;*:</p>

<pre class="lang-cpp prettyprint-override"><code>const char *monthShort[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
                            "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
</code></pre>

<p>The same applies to the other arrays of strings: <code>daysLong</code>, <code>daysShort</code>
and <code>monthLong</code>. As a consequence, the prototypes of the methods
<code>getDOWStr()</code> and <code>getMonthStr()</code> should be changed in order to return a
<code>const char *</code>.</p>

<p>BTW, are you sure this library is still maintained? This should have
been fixed a long time ago, and it seems the source was last modified in
2015. You may be better off using a more modern alternative. For
instance, in the Arduino library manager, you can find <a href="https://www.arduinolibraries.info/libraries/ds3231" rel="nofollow noreferrer">DS3231</a> and
Adafruit's <a href="https://www.arduinolibraries.info/libraries/rt-clib" rel="nofollow noreferrer">RTClib</a>.</p>
