From 917425ca6da99138b9c63bd6d95d3ed46ecd66f0 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Fri, 17 Oct 2025 16:12:58 -0300 Subject: [PATCH] posix: Defined _POSIX_VDISABLE as integer literal The constant should be used with c_cc, which for all supported ABIs is defined as unsigned char. By using it as literar char constant, clang triggers an error when compared with signal literal on ABIs that define 'char' as unsigned. On aarch64, clang shows: ../sysdeps/posix/fpathconf.c:118:21: error: right side of operator converted from negative value to unsigned: -1 to 18446744073709551615 [-Werror] #if _POSIX_VDISABLE == -1 ~~~~~~~~~~~~~~~ ^ ~~ Reviewed-by: Collin Funk --- sysdeps/mach/hurd/bits/posix_opt.h | 2 +- sysdeps/unix/sysv/linux/bits/posix_opt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sysdeps/mach/hurd/bits/posix_opt.h b/sysdeps/mach/hurd/bits/posix_opt.h index b7f80e32e1..2da2921bf5 100644 --- a/sysdeps/mach/hurd/bits/posix_opt.h +++ b/sysdeps/mach/hurd/bits/posix_opt.h @@ -53,7 +53,7 @@ /* Elements of the `c_cc' member of `struct termios' structure can be disabled by using the value _POSIX_VDISABLE. */ -#define _POSIX_VDISABLE '\0' +#define _POSIX_VDISABLE 0 /* Different Hurd filesystems might do these differently. diff --git a/sysdeps/unix/sysv/linux/bits/posix_opt.h b/sysdeps/unix/sysv/linux/bits/posix_opt.h index 60ab46a575..d55f907b0f 100644 --- a/sysdeps/unix/sysv/linux/bits/posix_opt.h +++ b/sysdeps/unix/sysv/linux/bits/posix_opt.h @@ -54,7 +54,7 @@ /* `c_cc' member of 'struct termios' structure can be disabled by using the value _POSIX_VDISABLE. */ -#define _POSIX_VDISABLE '\0' +#define _POSIX_VDISABLE 0 /* Filenames are not silently truncated. */ #define _POSIX_NO_TRUNC 1