configure.ac: enable -Wwrite-strings

As discussed in bug #185 [1], const strings should be protected
from being overwritten. This change adds -Wwrite-strings to the
compiler warning flags and fixes resulting warnings by making
static strings const.

[1] https://github.com/obgm/libcoap/issues/185
This commit is contained in:
Olaf Bergmann committed 2018-05-19 09:27:50 +02:00
1 parent 9f68329f70
commit a2d263356e
6 files changed
+9 -8

No files matched your search

+1 -1
View File
@@ -132,7 +132,7 @@ struct coap_session_t;
* @return A zero-terminated string describing the error, or @c NULL if not
* found.
*/
char *coap_response_phrase(unsigned char code);
const char *coap_response_phrase(unsigned char code);
#define COAP_ERROR_PHRASE_LENGTH 32 /**< maximum length of error phrase */