8187667: Disable deprecation warning for readdir_r
authorehelin
Mon, 18 Sep 2017 15:06:28 +0200
changeset 47621 f5f2a2d13775
parent 47620 39575526c6d9
child 47622 817f2a7019e4
8187667: Disable deprecation warning for readdir_r Reviewed-by: dholmes, sjohanss
src/hotspot/os/linux/os_linux.inline.hpp
--- a/src/hotspot/os/linux/os_linux.inline.hpp	Thu Oct 12 01:18:38 2017 +0000
+++ b/src/hotspot/os/linux/os_linux.inline.hpp	Mon Sep 18 15:06:28 2017 +0200
@@ -98,6 +98,11 @@
 
 inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf)
 {
+// readdir_r has been deprecated since glibc 2.24.
+// See https://sourceware.org/bugzilla/show_bug.cgi?id=19056 for more details.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
   dirent* p;
   int status;
   assert(dirp != NULL, "just checking");
@@ -111,6 +116,8 @@
     return NULL;
   } else
     return p;
+
+#pragma GCC diagnostic pop
 }
 
 inline int os::closedir(DIR *dirp) {