text: go to bug id or search bugs for
  Description:
  ------------
  Zend/zend_operators.h: In function `void* zend_memrchr(const void*, int, unsigned int)':
  Zend/zend_operators.h:250: warning: cast from `const void*' to `unsigned char*' discards qualifiers from pointer target type
  Zend/zend_operators.h:250: warning: cast from `const void*' to `unsigned char*' discards qualifiers from pointer target type
  In code snippet, line 250 refers to the two recasts of argument s.
  Reproduce code:
  ---------------
  static inline void *zend_memrchr(const void *s, int c, size_t n)
  {
  register unsigned char *e;
  if (n <= 0) {
  return NULL;
  }
  for (e = (unsigned char *)s + n - 1; e >= (unsigned char *)s; e--) {
  if (*e == (unsigned char)c) {
  return (void *)e;
  }
  }
  return NULL;
  }
  Expected result:
  ----------------
  No compiler warnings.
  Add a Patch
  Add a Pull Request
  What compiler do you use?
  No feedback was provided for this bug for over a week, so it is
  being suspended automatically. If you are able to provide the
  information that was originally requested, please do so and change
  the status of the bug back to "Open".
  Sorry for the late response. Your email hit my company spam filter for some reason. Just found it while going through the bulk mail folder.
  To answer your question, I'm using the MIPS cross-compiler (GCC 3.3.2 and GLIBC 2.3.2) on Linux x86. I know that's not the latest GCC compiler by a long shot, but just from reviewing the code, it does appear that the const declaration is being discarded by recasting the parameter as an unsigned char.
  You can safely ignore it.
  And no, I can't reproduce this warning with GCC4 & GCC3.4.6 or any other compiler.