Bug 15788 - libreplace:readline: gcc 15 complains about incompatible pointer types
Summary: libreplace:readline: gcc 15 complains about incompatible pointer types
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build (show other bugs)
Version: 4.21.0
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-21 17:03 UTC by Andreas Schneider
Modified: 2025-02-03 14:43 UTC (History)
2 users (show)

See Also:


Attachments
patch for 4.21 (3.97 KB, patch)
2025-01-22 10:36 UTC, Andreas Schneider
ab: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schneider 2025-01-21 17:03:02 UTC
CPPFunction is already deprecated since quite some time, but now gcc 15 turns it also into an error when casting to that type.

../../libcli/smbreadline/smbreadline.c: In function ‘smb_readline’:
../../libcli/smbreadline/smbreadline.c:139:17: warning: ‘CPPFunction’ is deprecated [-Wdeprecated-declarations]
  139 |                 rl_attempted_completion_function = RL_COMPLETION_CAST completion_fn;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libcli/smbreadline/smbreadline.c:139:50: error: assignment to ‘char ** (*)(const char *, int,  int)’ from incompatible pointer type ‘char ** (*)(void)’ [-Wincompatible-pointer-types]
  139 |                 rl_attempted_completion_function = RL_COMPLETION_CAST completion_fn;
      |                                                  ^
Comment 1 Samba QA Contact 2025-01-21 19:39:03 UTC
This bug was referenced in samba master:

dbff53f77680f0ccd022f2d864ba6ae7585a34b7
9aa5c43315d83c19514251a11c4fba5a137f2821
Comment 2 Andreas Schneider 2025-01-22 10:36:05 UTC
Created attachment 18536 [details]
patch for 4.21
Comment 3 Alexander Bokovoy 2025-01-22 10:37:23 UTC
Comment on attachment 18536 [details]
patch for 4.21

LGTM
Comment 4 Andreas Schneider 2025-01-22 10:38:27 UTC
Jule, please apply the patch to 4.21. Thanks!
Comment 5 Jule Anger 2025-01-23 14:06:25 UTC
Pushed to autobuild-v4-21-test.
Comment 6 Samba QA Contact 2025-01-23 15:16:05 UTC
This bug was referenced in samba v4-21-test:

52f4e853c0b215c52dd615e02360e3d71d354464
81fc67cce2a076236a82ab5336ed3a9260f12af1
Comment 7 Jule Anger 2025-02-03 14:43:07 UTC
Closing out bug report.

Thanks!