usgs-coupled / iphreeqc

ctest results:
https://my.cdash.org/index.php?project=iphreeqc
7 stars 5 forks source link

Apple-Clang 15 with C++11 or higher reports warnings `Wwritable-strings` in `PBasic.cpp` #50

Closed SpaceIm closed 3 months ago

SpaceIm commented 3 months ago

Apple-Clang 15 reports several warnings Wwritable-strings when project is compiled with C++11 standard or above:

[54/93] Building CXX object CMakeFiles/IPhreeqc.dir/src/phreeqcpp/PBasic.cpp.o
/Users/spaceim/.conan2/p/b/iphre4346b2e99c536/b/src/src/phreeqcpp/PBasic.cpp:4821:67: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
                n.UU.val = (parse_all) ? 1 : PhreeqcPtr->basic_callback(x1, x1, "cell_pore_volume");
                                                                                ^
/Users/spaceim/.conan2/p/b/iphre4346b2e99c536/b/src/src/phreeqcpp/PBasic.cpp:4828:67: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
                n.UU.val = (parse_all) ? 1 : PhreeqcPtr->basic_callback(x1, x1, "cell_porosity");
                                                                                ^
/Users/spaceim/.conan2/p/b/iphre4346b2e99c536/b/src/src/phreeqcpp/PBasic.cpp:4835:67: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
                n.UU.val = (parse_all) ? 1 : PhreeqcPtr->basic_callback(x1, x1, "cell_saturation");
                                                                                ^
/Users/spaceim/.conan2/p/b/iphre4346b2e99c536/b/src/src/phreeqcpp/PBasic.cpp:4842:67: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
                n.UU.val = (parse_all) ? 1 : PhreeqcPtr->basic_callback(x1, x1, "cell_volume");
                                                                                ^
/Users/spaceim/.conan2/p/b/iphre4346b2e99c536/b/src/src/phreeqcpp/PBasic.cpp:4849:67: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
                n.UU.val = (parse_all) ? 1 : PhreeqcPtr->basic_callback(x1, x1, "transport_cell_no");
                                                                                ^
/Users/spaceim/.conan2/p/b/iphre4346b2e99c536/b/src/src/phreeqcpp/PBasic.cpp:4856:67: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
                n.UU.val = (parse_all) ? 1 : PhreeqcPtr->basic_callback(x1, x1, "velocity_x");
                                                                                ^
/Users/spaceim/.conan2/p/b/iphre4346b2e99c536/b/src/src/phreeqcpp/PBasic.cpp:4863:67: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
                n.UU.val = (parse_all) ? 1 : PhreeqcPtr->basic_callback(x1, x1, "velocity_y");
                                                                                ^
/Users/spaceim/.conan2/p/b/iphre4346b2e99c536/b/src/src/phreeqcpp/PBasic.cpp:4870:67: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
                n.UU.val = (parse_all) ? 1 : PhreeqcPtr->basic_callback(x1, x1, "velocity_z");
                                                                                ^
8 warnings generated.
scharlton2 commented 3 months ago

Closed by #57