bug#81554: gcc useless cast warning in X11 files

Eli Zaretskii <[email protected]> Wed, 05 Aug 2026 15:18:14 +0300
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
> From: Jonathan Mitchell <[email protected]>
> Date: Tue, 4 Aug 2026 16:52:16 -0500
> 
> While compiling the master branch in Debian forky/testing using the
> X11 Lucid toolkit, I get gcc warnings about useless ‘char *’ 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]

Paul, WDYT about this?  Should we perhaps turn off this warning
option?