Title | MPS produces warnings when compiled with -Wwrite-strings |
Status | closed |
Priority | nice |
Assigned user | Gareth Rees |
Organization | Ravenbrook |
Description | When compiled with clang -Wwrite-strings, the MPS fails to compile: arenavm.c:1788:14: error: assigning to 'char *' from 'const char [3]' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] this->name = "VM"; ^ ~~~~ This problem came up when trying to integrate the MPS with Ruby, which compiles with -Wwrite-strings. In order to make integrations go smoothly, the MPS ought to compile under the most stringent compiler options like this. |
Analysis | There are going to be quite a lot of "char *" to "const char *" changes. |
How found | manual_test |
Evidence | None as yet. |
Created by | Gareth Rees |
Created on | 2013-09-30 16:50:54 |
Last modified by | Gareth Rees |
Last modified on | 2013-10-01 10:54:29 |
History | 2013-09-30 GDR Created. |
Change | Effect | Date | User | Description |
---|---|---|---|---|
183498 | closed | 2013-10-01 10:52:45 | Gareth Rees | Avoid warnings when compiling with -Wwrite-strings: * Use const char * in places where we want to assign string constants. Avoid warnings when compiling with -Wextra: * Avoid if statement with empty body in amcsshe.c * Avoid comparison of unsigned >= 0. |
183494 | open | 2013-09-30 17:18:52 | Gareth Rees | Turn on -Wextra -Wwrite-strings when compiling with GCC or Clang. Add missing initializer to mps_args_none. Change "char *" to "const char *" where necessary. |