+#include <stdint.h>
In other words, no need to drag this in...
#include <dirent.h>
extern int getdents (int fd, void *dp, int count);
@@ -75,7 +76,7 @@ _DEFUN(readdir, (dirp),
continue;
}
dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc);
and everything between here...
- if ((int)dp & 03) { /* bogus pointer check */
+ if ((intptr_t)dp & 03) { /* bogus pointer check */
#ifdef HAVE_DD_LOCK
__lock_release_recursive(dirp->dd_lock);
#endif
return NULL;
}
...and here is just stupid. POSIX already states that behavior is
undefined if you pass in a bogus pointer; and in a compliant program,
readdir should only ever be called on a valid pointer, making this check
look like nothing more than dead code. I see no need to bloat the code
with an attempt to gracefully deal with a bogus pointer.