diff --git a/include/dirent.h b/include/dirent.h --- a/include/dirent.h +++ b/include/dirent.h @@ -116,7 +116,8 @@ struct dirent * readdir(DIR *); #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500 -int readdir_r(DIR *, struct dirent *, struct dirent **); +int readdir_r(DIR *, struct dirent *, struct dirent **) + __deprecated1("Does not take variable {NAME_MAX} into account"); #endif void rewinddir(DIR *); #if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 700 diff --git a/lib/libc/gen/readdir.c b/lib/libc/gen/readdir.c --- a/lib/libc/gen/readdir.c +++ b/lib/libc/gen/readdir.c @@ -134,3 +134,5 @@ } __strong_reference(__readdir_r, readdir_r); +__warn_references(readdir_r, + "warning: this program uses readdir_r(), which is unsafe.");