[PATCH] tst-getdents64.c: Mark as UNSUPPORTED when compiled with Clang

H.J. Lu hjl.tools@gmail.com
Wed Dec 18 01:37:55 GMT 2024


Since Clang doesn't support variable length array in structure:

./sysdeps/unix/sysv/linux/tst-getdents64.c:118:18: error: fields must have a constant size: 'variable length array in structure' extension will never be supported
  118 |             char buffer[buffer_size];
      |                  ^

Mark tst-getdents64.c as UNSUPPORTED when compiled with Clang.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
 sysdeps/unix/sysv/linux/tst-getdents64.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/tst-getdents64.c b/sysdeps/unix/sysv/linux/tst-getdents64.c
index ba66d49a2e..c68499f3c7 100644
--- a/sysdeps/unix/sysv/linux/tst-getdents64.c
+++ b/sysdeps/unix/sysv/linux/tst-getdents64.c
@@ -16,6 +16,7 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef __clang__
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -187,3 +188,12 @@ do_test (void)
 }
 
 #include <support/test-driver.c>
+#else
+#include <support/test-driver.h>
+
+int
+main (void)
+{
+  return EXIT_UNSUPPORTED;
+}
+#endif
-- 
2.47.1



More information about the Libc-alpha mailing list