GNU bug report logs -
#73307
Fix ctype(3) usage
Previous Next
Reported by: Thomas Klausner <wiz <at> gatalith.at>
Date: Mon, 16 Sep 2024 21:26:01 UTC
Severity: normal
Tags: patch
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Tags: patch
When compiling emacs on NetBSD-10.99.12/amd64, I get the following
warning
In file included from /usr/include/ctype.h:100,
from fns.c:29:
fns.c: In function 'Fyes_or_no_p':
fns.c:3582:33: warning: array subscript has type 'char' [-Wchar-subscripts]
3582 | if ((len > 0) && !isspace (s[len - 1]))
| ^
The NetBSD man page for ctype(3): https://man.netbsd.org/ctype.3
is quite explicit about the problems with this - ctype(3) functions only
accept -1 and "unsigned char" and you can get very weird problems if
this is disregarded.
The attached patch adds the missing cast.
In GNU Emacs 31.0.50 (build 1, x86_64--netbsd, GTK+ Version 3.24.43,
cairo version 1.18.0) of 2024-09-16
Repository revision: f27553c30a772a0103d2e6762e4d7f588f302e4b
Repository branch: HEAD
System Description: NetBSD 10.99.12/amd64
Configured using:
'configure --srcdir=/scratch/wip/emacs-git/work/emacs
--localstatedir=/var --with-native-compilation --without-ns
--without-imagemagick --without-xaw3d --with-x-toolkit=gtk3
--prefix=/usr/pkg --build=x86_64--netbsd --host=x86_64--netbsd
--infodir=/usr/pkg/info --mandir=/usr/pkg/man
--enable-option-checking=yes 'CFLAGS=-O2 -g -g -fstack-clash-protection
-I/usr/pkg/include -I/usr/include -I/usr/pkg/include/freetype2
-I/usr/pkg/include/glib-2.0 -I/usr/pkg/include/gio-unix-2.0
-I/usr/pkg/lib/glib-2.0/include -I/usr/pkg/include/harfbuzz
-I/usr/pkg/include/libdrm' 'CPPFLAGS=-g -I/usr/pkg/include
-I/usr/include -I/usr/pkg/include/freetype2 -I/usr/pkg/include/glib-2.0
-I/usr/pkg/include/gio-unix-2.0 -I/usr/pkg/lib/glib-2.0/include
-I/usr/pkg/include/harfbuzz -I/usr/pkg/include/libdrm'
'LDFLAGS=-Wl,-R/usr/pkg/gcc14/lib -Wl,-zrelro -Wl,-znow -L/usr/pkg/lib
-Wl,-R/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib''
[patch-src_fns.c (text/x-c, attachment)]
This bug report was last modified 297 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.