Bug 2336279 - amanda fails to build with C23 ("ndma_comm_dispatch.c:207:23: error: too many arguments to function 'rrxl->request_xto9'")
Summary: amanda fails to build with C23 ("ndma_comm_dispatch.c:207:23: error: too many...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: amanda
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jason Tibbitts
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: gcc-15-mass-prebuild
TreeView+ depends on / blocked
 
Reported: 2025-01-08 00:00 UTC by Dave Malcolm
Modified: 2025-02-14 19:55 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-02-14 19:55:45 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dave Malcolm 2025-01-08 00:00:09 UTC
I'm experimentally rebuilding rawhide with the not-yet-released GCC 15 to see if anything breaks, and to help write the porting guide.  See https://fedoraproject.org/wiki/User:Dmalcolm/gcc-15

My test build with GCC 15 failed:
https://copr.fedorainfracloud.org/coprs/dmalcolm/gcc-15-smoketest-3.failed/build/8476074/

whereas my test build with GCC 14 succeeded:
https://copr.fedorainfracloud.org/coprs/dmalcolm/gcc-15-smoketest-3.failed.checker/build/8477659/

Looking at the failure logs e.g.
https://download.copr.fedorainfracloud.org/results/dmalcolm/gcc-15-smoketest-3.failed/fedora-rawhide-x86_64/08476074-amanda/builder-live.log.gz

I see:

ndma_comm_dispatch.c: In function 'ndma_dispatch_request':
ndma_comm_dispatch.c:207:23: error: too many arguments to function 'rrxl->request_xto9'
  207 |                 rc = (*rrxl->request_xto9)(
      |                      ~^~~~~~~~~~~~~~~~~~~~
ndma_comm_dispatch.c:227:14: error: too many arguments to function 'rrxl->free_request_xto9'
  227 |             (*rrxl->free_request_xto9)((void*)&xa->request.body);
      |             ~^~~~~~~~~~~~~~~~~~~~~~~~~
ndma_comm_dispatch.c:240:23: error: too many arguments to function 'rrxl->reply_9tox'
  240 |                 rc = (*rrxl->reply_9tox)(
      |                      ~^~~~~~~~~~~~~~~~~~
ndma_comm_dispatch.c:246:22: error: too many arguments to function 'rrxl->free_reply_9tox'
  246 |                     (*rrxl->free_reply_9tox)((void*)&arg_xa->reply.body);
      |                     ~^~~~~~~~~~~~~~~~~~~~~~~
ndma_comm_dispatch.c: In function 'ndma_call_no_tattle':
ndma_comm_dispatch.c:406:23: error: too many arguments to function 'rrxl->request_9tox'
  406 |                 rc = (*rrxl->request_9tox)(
      |                      ~^~~~~~~~~~~~~~~~~~~~
ndma_comm_dispatch.c:474:24: error: too many arguments to function 'rrxl->reply_xto9'
  474 |                 xrc = (*rrxl->reply_xto9)(
      |                       ~^~~~~~~~~~~~~~~~~~



This is probably due to GCC 15 now defaulting to -std=gnu23, whereas GCC 14 defaulted to -std=gnu17, and C23 is stricter about function prototypes than C17.  It's probably fixable by fixing the function prototypes (or by manually adding -std=gnu17 to the C build flags)


Reproducible: Always

Comment 1 Jason Tibbitts 2025-01-15 19:45:47 UTC
The suggested method for testing this out seems to not be working, but my understanding is that the new compiler has already gone to rawhide so I just need to wait for a compose and a push before I can do any local testing.

Interestingly, in the amanda code the prototypes for these functions already seem to exist, but they're commented out.  Probably just need to uncomment them.  But upstream really does seem to be dead, and the remaining users and maintainers are going to need to decide what is to be done.

Comment 2 Siddhesh Poyarekar 2025-01-17 13:17:02 UTC
Failed in the mass rebuild as well:

https://koji.fedoraproject.org/koji/buildinfo?buildID=2617046

Comment 3 Jason Tibbitts 2025-02-14 19:55:45 UTC
So it turns out that fixing the code for C23 compatibility is beyond my abilities.  The code in ndmp-src is from the turn of the century and sets up an array of structs containing function pointers and while the functions have the same signatures in terms of basic types, the compiler sees them as all being different.  I'm just not sure how to fix that without throwing in potentially hundreds of casts; my C experience was all gained around the time they added the "ANSI C" box to the front of the K&R book.

For now I've just passed "-std=c17" and everything builds fine.  An alternate approach would to simply not build the problematic code, which would be done by passing "--without-ndmp" to cofigure.  That code enables writing to some kind of remote backup server supporting the NDMP protocol and I have no idea how well-used that is these days.

Regardless, if a C expert wants to give me some hints, I'll be happy try doing it properly.


Note You need to log in before you can comment on or make changes to this bug.