GNU bug report logs -
#47452
28.0.50; Compilation warnings in xterm.c
Previous Next
Reported by: Lars Ingebrigtsen <larsi <at> gnus.org>
Date: Sun, 28 Mar 2021 15:06:02 UTC
Severity: minor
Tags: fixed
Found in version 28.0.50
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47452 in the body.
You can then email your comments to 47452 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#47452
; Package
emacs
.
(Sun, 28 Mar 2021 15:06:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Lars Ingebrigtsen <larsi <at> gnus.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 28 Mar 2021 15:06:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
This started happening on a Debian/bullseye machine some days ago:
xterm.c: In function ‘x_create_toolkit_scroll_bar’:
xterm.c:6226:7: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
6226 | XtSetArg (av[ac], XtNbeNiceToColormap,
| ^~~~~~~~
xterm.c:6237:7: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
6237 | XtSetArg (av[ac], XtNbeNiceToColormap, False);
| ^~~~~~~~
xterm.c:6244:4: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
6244 | XtSetArg (av[ac], XtNtopShadowPixel, pixel);
| ^~~~~~~~
xterm.c:6250:4: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
6250 | XtSetArg (av[ac], XtNbottomShadowPixel, pixel);
xterm.c: In function ‘x_create_horizontal_toolkit_scroll_bar’:
xterm.c:6427:7: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
6427 | XtSetArg (av[ac], XtNbeNiceToColormap,
| ^~~~~~~~
xterm.c:6438:7: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
6438 | XtSetArg (av[ac], XtNbeNiceToColormap, False);
| ^~~~~~~~
xterm.c:6445:4: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
6445 | XtSetArg (av[ac], XtNtopShadowPixel, pixel);
| ^~~~~~~~
xterm.c:6451:4: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
6451 | XtSetArg (av[ac], XtNbottomShadowPixel, pixel);
| ^~~~~~~~
It does not happen on my other Debian/bullseye machine, which is
confusing: Both are "apt update; apt upgraded" right now, so they should
be very similar.
From the machine that has the warnings:
In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2021-03-28 built on stories
Repository revision: cf607c262e15c873961fdfcced254e6f8e82f8d7
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12010000
System Description: Debian GNU/Linux bullseye/sid
This is the one that doesn't have the warning:
In GNU Emacs 28.0.50 (build 51, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
of 2021-03-28 built on xo
Repository revision: cf607c262e15c873961fdfcced254e6f8e82f8d7
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12010000
System Description: Debian GNU/Linux bullseye/sid
Ah, so the warning is when compiling without Gtk? Makes sense; I
removed some libraries from the other machine for doing various tests
the other day
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#47452
; Package
emacs
.
(Sun, 28 Mar 2021 15:25:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 47452 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> This started happening on a Debian/bullseye machine some days ago:
>
> xterm.c: In function ‘x_create_toolkit_scroll_bar’:
> xterm.c:6226:7: warning: assignment discards ‘const’ qualifier from
> pointer target type [-Wdiscarded-qualifiers]
> 6226 | XtSetArg (av[ac], XtNbeNiceToColormap,
> | ^~~~~~~~
Oh, right:
#define XtSetArg(arg, n, d) \
((void)( (arg).name = (n), (arg).value = (XtArgVal)(d) ))
And arg.name is.... A String, which is
#ifdef _CONST_X_STRING
typedef const char *String;
#else
typedef char *String;
#endif
Uhm... So it depends.
But XtNbeNiceToColormap is just
#define XtNbeNiceToColormap "beNiceToColormap"
which... Uhm. This "fixes" the warning:
XtSetArg (av[ac], (char*)XtNbeNiceToColormap,
DefaultDepthOfScreen (FRAME_X_SCREEN (f)) < 16);
But...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#47452
; Package
emacs
.
(Tue, 27 Apr 2021 02:28:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 47452 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> And arg.name is.... A String, which is
>
> #ifdef _CONST_X_STRING
> typedef const char *String;
> #else
> typedef char *String;
> #endif
Pushed a fix now (just casting the argument to String).
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Tue, 27 Apr 2021 02:28:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 28.1, send any further explanations to
47452 <at> debbugs.gnu.org and Lars Ingebrigtsen <larsi <at> gnus.org>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Tue, 27 Apr 2021 02:28:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 25 May 2021 11:24:08 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 335 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.