Skip to content

Eliminate most 'deprecated declarations' warnings - #122

Open
jkeenan wants to merge 2 commits into
eserte:masterfrom
jkeenan:deprecated-declarations-20260705
Open

Eliminate most 'deprecated declarations' warnings#122
jkeenan wants to merge 2 commits into
eserte:masterfrom
jkeenan:deprecated-declarations-20260705

Conversation

@jkeenan

@jkeenan jkeenan commented Jul 11, 2026

Copy link
Copy Markdown

If I build Tk-804.036 against a Perl executable built on Linux and compiled with gcc-13 (currently the most recent version of gcc against which Tk's make will complete), I get the following count of build-time warnings:

$ report-build-warnings 804.036-0-gcc-13.make.output.txt 
File:  804.036-0-gcc-13.make.output.txt

  Wdeprecated-declarations                   9
  Wdiscarded-qualifiers                      1
  Wformat-overflow=                          5
  Wimplicit-int                              3
  Wincompatible-pointer-types                7
  Wint-to-pointer-cast                      42
  Wpointer-to-int-cast                      25
  Wstringop-overflow=                        1

The patches in this pull request, when applied will reduce the number of Wdeprecated-declarations warnings from 9 to 1.

$ report-build-warnings 07ef24a882.gcc13.make.output.txt 
File:  07ef24a882.gcc13.make.output.txt

  Wdeprecated-declarations                   1
  Wdiscarded-qualifiers                      1
  Wformat-overflow=                          5
  Wimplicit-function-declaration             1
  Wimplicit-int                              3
  Wincompatible-pointer-types                7
  Wint-to-pointer-cast                      42
  Wpointer-to-int-cast                      25
  Wstringop-overflow=                        1

For changes in tkUnixKey.c, consult DDG search for "XKeycodeToKeysym is deprecated".

For changes in Event/Event.xs, see perldoc perl5380delta.

The one remaining Wdeprecated-declarations build-time warning appears during make like this:

In file included from Xlib_f.c:17:
Xlib.t:334:1: warning: ‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
  334 | VFUNC(KeySym,XKeycodeToKeysym,V_XKeycodeToKeysym,_ANSI_ARGS_((Display *, unsigned int, int)))
      | ^~~~~

And here's the relevant source code in pTk/Xlib.t:

333 #ifndef XKeycodeToKeysym
334 VFUNC(KeySym,XKeycodeToKeysym,V_XKeycodeToKeysym,_ANSI_ARGS_((Display *, unsigned int, int)))
335 #endif /* #ifndef XKeycodeToKeysym */

A simple search-and-replace, XKeycodeToKeysym -> XkbKeycodeToKeysym, did not compile, so I left this instance alone.

jkeenan added 2 commits July 5, 2026 08:29
This change reduced the count of Wdeprecated-declaration build-time warnings
(gcc-13 Linux) from 9 to 3.

DDG search: XKeycodeToKeysym is deprecated
The change in this macro is documented in pod/perl5380delta.pod

This change reduced the count of Wdeprecated-declaration build-time warnings
(gcc-13 Linux) from 3 to 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant