Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH 1/6] fix implicit typecast for strict compilers



On Jun 7,  7:18pm, Nikolas Garofil wrote:
}
} diff --git a/Src/compat.c b/Src/compat.c
} index cc4e876..81a95d5 100644
} --- a/Src/compat.c
} +++ b/Src/compat.c
} @@ -40,7 +40,7 @@ strstr(const char *s, const char *t)
}      char *p1, *p2;
}  
}      for (; *s; s++) {
} -        for (p1 = s, p2 = t; *p2; p1++, p2++)
} +        for (p1 = (char*)s, p2 = (char*)t; *p2; p1++, p2++)
}              if (*p1 != *p2)
}                  break;
}          if (!*p2)
} -- 


Wouldn't the right thing here be to declare

	const char *p1, *p2;

instead of casting?

-- 
Barton E. Schaefer



Messages sorted by: Reverse Date, Date, Thread, Author