[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#47452: 28.0.50; Compilation warnings in xterm.c
From: |
Lars Ingebrigtsen |
Subject: |
bug#47452: 28.0.50; Compilation warnings in xterm.c |
Date: |
Sun, 28 Mar 2021 17:24:23 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Lars Ingebrigtsen <larsi@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