Collin Funk <[email protected]> writes: > Like the other platforms with this issue, it is not worth replacing the > type. I pushed the attached patch ignoring the test on QNX and updating > the documentation.
Oh, I forgot this test is also in sys_stat-h. So I pushed one more patch for that. Collin
>From 1141f12011ff79542eadb84d15502272c52584d5 Mon Sep 17 00:00:00 2001 Message-ID: <1141f12011ff79542eadb84d15502272c52584d5.1767232916.git.collin.fu...@gmail.com> From: Collin Funk <[email protected]> Date: Wed, 31 Dec 2025 17:59:14 -0800 Subject: [PATCH] sys_stat-h tests: Fix a static_assert failure on QNX. * tests/test-sys_stat-h.c [__QNX__]: Don't check that blksize_t and blkcnt_t are signed. Add some parentheses for readability. * doc/posix-headers/sys_stat.texi: Mention that these types are unsigned on this platform. --- ChangeLog | 6 ++++++ doc/posix-headers/sys_stat.texi | 2 +- tests/test-sys_stat-h.c | 7 ++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f3fa3180d9..85628fbf0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2025-12-31 Collin Funk <[email protected]> + sys_stat-h tests: Fix a static_assert failure on QNX. + * tests/test-sys_stat-h.c [__QNX__]: Don't check that blksize_t and + blkcnt_t are signed. Add some parentheses for readability. + * doc/posix-headers/sys_stat.texi: Mention that these types are unsigned + on this platform. + sys_types-h tests: Fix a static_assert failure on QNX. * tests/test-sys_types-h.c [__QNX__]: Don't check that blksize_t and blkcnt_t are signed. Add some parentheses for readability. diff --git a/doc/posix-headers/sys_stat.texi b/doc/posix-headers/sys_stat.texi index 950fd89f4b..0d61210f64 100644 --- a/doc/posix-headers/sys_stat.texi +++ b/doc/posix-headers/sys_stat.texi @@ -62,7 +62,7 @@ @node sys/stat.h @item On some platforms the types @code{blksize_t} and @code{blkcnt_t} are unsigned: @c https://sourceware.org/PR33355 -Android, glibc/alpha. +QNX, Android, glibc/alpha. @item The macro @code{S_IFBLK} is missing on some platforms: MSVC 14. diff --git a/tests/test-sys_stat-h.c b/tests/test-sys_stat-h.c index 6936cc7a8b..4ddfad0aed 100644 --- a/tests/test-sys_stat-h.c +++ b/tests/test-sys_stat-h.c @@ -339,14 +339,15 @@ struct timespec st; static_assert (TYPE_SIGNED (off_t)); /* POSIX requires that blksize_t is a signed integer type. */ -#if !(defined __ANDROID__ \ +#if !(defined __ANDROID__ || defined __QNX__ \ || (defined __FreeBSD_kernel__ && !defined __FreeBSD__) \ - || defined __GLIBC__ && defined __alpha) + || (defined __GLIBC__ && defined __alpha)) static_assert (TYPE_SIGNED (blksize_t)); #endif /* POSIX requires that blkcnt_t is a signed integer type. */ -#if !(defined __ANDROID__ || defined __GLIBC__ && defined __alpha) +#if !(defined __ANDROID__ || defined __QNX__ \ + || (defined __GLIBC__ && defined __alpha)) static_assert (TYPE_SIGNED (blkcnt_t)); #endif -- 2.52.0
