Bug 1221006

Summary: GCC 14: linux-atm package fails
Product: [openSUSE] openSUSE Tumbleweed Reporter: Michal Jireš <michal.jires>
Component: OtherAssignee: Jiri Bohac <jbohac>
Status: NEW --- QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: jbohac, mjambor
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 1220571    

Description Michal Jireš 2024-03-06 05:41:26 UTC
Building linux-atm with GCC 14 fails here:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:Gcc7/linux-atm/standard/x86_64

Due to (exhaustive list of errors):

  100 |         fprintf(stderr,"internal error: len %d %% %d\n",req.length,
conn.c: In function ‘accept_conn’:
conn.c:414:57: error: passing argument 3 of ‘accept’ from incompatible pointer type [-Wincompatible-pointer-types]
  414 |         fd = accept(conn->fd, (struct sockaddr *)&addr, &len);
      |                                                         ^~~~
      |                                                         |
      |                                                         size_t * {aka long unsigned int *}
In file included from ../../src/include/atm.h:10,
                 from conn.c:42:
/usr/include/sys/socket.h:307:42: note: expected ‘socklen_t * restrict’ {aka ‘unsigned int * restrict’} but argument is of type ‘size_t *’ {aka ‘long unsigned int *’}
  307 |                    socklen_t *__restrict __addr_len);
      |                    ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

See the meta bug#1220571 for more info.
Comment 1 Martin Jambor 2024-03-06 10:33:54 UTC
FTR, notes on how Fedora is dealing this should be available here (though the patch there does not seem to fix the pointer incompatibility issue reported here):
https://gitlab.com/fweimer-rh/fedora-modernc/-/blob/main/pkg/l/linux-atm.md?ref_type=heads
Comment 2 Martin Jambor 2024-07-12 11:26:27 UTC
The include that Fedora adds in their package is already present in our package.

The bug is caused by a wrong type being passed to function accept (which IMHO could cause wrong behavior on some big-endian platform), I have created https://build.opensuse.org/request/show/1187046 to address that.