bug#81554: gcc useless cast warning in X11 files

Jonathan Mitchell <[email protected]> Tue, 4 Aug 2026 16:52:16 -0500
Newsgroups gmane.emacs.bugs
Message-ID <CAAnK0TbNzZ6mw=zf-cidOy6So16AT=V7QJMbJu0dTT4M4PDeMg@mail.gmail.com>
While compiling the master branch in Debian forky/testing using the
X11 Lucid toolkit, I get gcc warnings about useless =E2=80=98char *=E2=80=
=99 casts in
X11 related C files.  The system gcc is (Debian 15.3.0-2) 15.3.0.

xmenu.c:1798:21: warning: useless cast to type 'char *' [-Wuseless-cast]
xdisp.c:18579:14: warning: useless cast to type 'char *' [-Wuseless-cast]
xfns.c:4229:21: warning: useless cast to type 'char *' [-Wuseless-cast]
xfns.c:4230:21: warning: useless cast to type 'char *' [-Wuseless-cast]
xfns.c:4231:21: warning: useless cast to type 'char *' [-Wuseless-cast]
xfns.c:4232:21: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:16193:25: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:16204:25: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:16211:29: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:16217:29: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:16401:25: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:16412:25: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:16419:29: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:16425:29: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30458:4: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30458:26: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30459:4: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30459:24: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30461:4: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30462:4: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30463:4: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30463:20: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30465:4: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30465:19: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30466:4: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30466:20: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30467:4: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30467:23: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30468:4: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30468:26: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30470:4: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30470:20: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30471:4: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30471:20: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30472:4: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30472:20: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30800:15: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:30804:24: warning: useless cast to type 'char *' [-Wuseless-cast]
xterm.c:31615:15: warning: useless cast to type 'char *' [-Wuseless-cast]
emacs.c:1710:29: warning: useless cast to type 'char *' [-Wuseless-cast]
emacs.c:2115:34: warning: useless cast to type 'char *' [-Wuseless-cast]
emacs.c:2133:31: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:57:4: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:57:26: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:62:4: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:62:28: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:66:4: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:66:28: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:68:4: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:68:30: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:71:4: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:71:37: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:74:4: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:74:27: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:76:4: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:76:28: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:77:44: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:78:4: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:78:29: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:79:40: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:80:4: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:80:27: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:82:4: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:82:28: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:84:4: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:84:28: warning: useless cast to type 'char *' [-Wuseless-cast]
widget.c:109:41: warning: useless cast to type 'char *' [-Wuseless-cast]


In GNU Emacs 32.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.18.4, Xaw3d scroll bars) of 2026-08-04 built on emacsdev
Repository revision: 8a88f3ed5aeece4a7c8edbebc83ed52479fbbfab
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12401013
System Description: Debian GNU/Linux forky/sid

Configured using:
 'configure --with-x-toolkit=3Dlucid --enable-checking=3Dyes,glyphs
 --enable-check-lisp-object-type 'CFLAGS=3D-O0 -g3''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XAW3D XDBE XIM XINERAMA XINPUT2
XPM XRANDR LUCID ZLIB

Important settings:
  locale-coding-system: nil

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-nonselected-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug lisp-mnt message mailcap yank-media puny
dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg
rfc6068 epg-config gnus-util time-date mm-decode mm-bodies mm-encode
mailabbrev gmm-utils mailheader sendmail mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-extra pp byte-opt gv
cl-print compile text-property-search comint subr-x mule-util ansi-osc
ansi-color ring comp-run bytecomp byte-compile comp-common rx thingatpt
help-fns radix-tree help-mode cl-loaddefs cl-lib rmc iso-transl tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo x-toolkit xinput2 x multi-tty move-toolbar make-network-process
tty-child-frames native-compile emacs)

Memory information:
((conses 16 91291 9276) (symbols 48 7363 0) (strings 32 27941 1695)
 (string-bytes 1 862283) (vectors 16 17410)
 (vector-slots 8 199428 10174) (floats 8 47 1) (intervals 56 346 0)
 (buffers 1064 13))