This fixes compilation of codepaths for dos-like filesystems
with Clang. When built with clang, it treats C input files as C++
when the compiler driver is invoked in C++ mode, triggering errors
when the return value of strchr() on a pointer to const is assigned
to a pointer to non-const variable.
This matches similar variables outside of the ifdefs for dos-like
path handling.
2020-09-07 Martin Storsjö <martin@martin.st>
gcc/
* dwarf2out.c (file_name_acquire): Make a strchr return value
pointer to const.
libcpp/
* files.c (remap_filename): Make a strchr return value pointer
to const.
f = strrchr (f, DIR_SEPARATOR);
#if defined (DIR_SEPARATOR_2)
{
- char *g = strrchr (fi->path, DIR_SEPARATOR_2);
+ const char *g = strrchr (fi->path, DIR_SEPARATOR_2);
if (g != NULL)
{
p = strchr (fname, '/');
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
{
- char *p2 = strchr (fname, '\\');
+ const char *p2 = strchr (fname, '\\');
if (!p || (p > p2))
p = p2;
}