Hi, Philipp Klaus Krause wrote: > gnulib contains some calls to strerror where the result is assigned > to a char *. However, according to the strerror specification, the > string returned by strerror should never be changed, so it would be > better to use const char * instead.
Good point. Yes, indeed. > For the 4 others,see the attached small patch. For the uses in the Autoconf tests, it's actually better to use 'char *', so that we notice if some system mistakenly declares the function with a wrong return type. But regarding the code in lib/ and tests/ you are right. I applied that change in your name, with this ChangeLog entry: 2020-10-13 Philipp Klaus Krause <p...@spth.de> (tiny change) Don't declare an intention to modify the return value of strerror. * tests/test-perror2.c (main): Assign the return value of strerror to a 'const char *' variable.