diff options
author | Martin Storsjö <martin@martin.st> | 2020-09-07 13:18:42 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-09-07 13:20:21 +0200 |
commit | 3fe3efe5c141a88a80c1ecc6aebc7f15d6426f62 (patch) | |
tree | d4832db5123a59b6a45fd2783e8f75d4e975784f /libcpp/files.c | |
parent | 2b0df0a6ac79b34f5fac4f3d456e8e14db220e4a (diff) | |
download | gcc-3fe3efe5c141a88a80c1ecc6aebc7f15d6426f62.zip gcc-3fe3efe5c141a88a80c1ecc6aebc7f15d6426f62.tar.gz gcc-3fe3efe5c141a88a80c1ecc6aebc7f15d6426f62.tar.bz2 |
gcc: Make strchr return value pointers const
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.
Diffstat (limited to 'libcpp/files.c')
-rw-r--r-- | libcpp/files.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libcpp/files.c b/libcpp/files.c index 3d48c38..b890b8e 100644 --- a/libcpp/files.c +++ b/libcpp/files.c @@ -1693,7 +1693,7 @@ remap_filename (cpp_reader *pfile, _cpp_file *file) p = strchr (fname, '/'); #ifdef HAVE_DOS_BASED_FILE_SYSTEM { - char *p2 = strchr (fname, '\\'); + const char *p2 = strchr (fname, '\\'); if (!p || (p > p2)) p = p2; } |