find_and_open_source casts away const, but hasn't needed to in a
while. This removes the cast and a strangely hostile comment.
gdb/ChangeLog
2019-05-17 Tom Tromey <tromey@adacore.com>
* source.c (find_and_open_source): Remove cast.
+2019-05-17 Tom Tromey <tromey@adacore.com>
+
+ * source.c (find_and_open_source): Remove cast.
+
2019-05-17 Tom Tromey <tromey@adacore.com>
* annotate.c (annotate_source): Make "filename" const.
/* Replace a path entry of $cdir with the compilation directory
name. */
#define cdir_len 5
- /* We cast strstr's result in case an ANSIhole has made it const,
- which produces a "required warning" when assigned to a nonconst. */
- p = (char *) strstr (source_path, "$cdir");
+ p = strstr (source_path, "$cdir");
if (p && (p == path || p[-1] == DIRNAME_SEPARATOR)
&& (p[cdir_len] == DIRNAME_SEPARATOR || p[cdir_len] == '\0'))
{