]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
posix: Defined _POSIX_VDISABLE as integer literal
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 17 Oct 2025 19:12:58 +0000 (16:12 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 20 Oct 2025 14:33:54 +0000 (11:33 -0300)
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 <collin.funk1@gmail.com>
sysdeps/mach/hurd/bits/posix_opt.h
sysdeps/unix/sysv/linux/bits/posix_opt.h

index b7f80e32e14762891200a4dc2b1194f790aecd6f..2da2921bf5ce8e94046cb67915028a8b126e0088 100644 (file)
@@ -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.
index 60ab46a575f25c0d97210d4f82c6d89a37883b3b..d55f907b0f8ece384d405b274c32946d4b879109 100644 (file)
@@ -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