Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 949491 - net-fs/openafs-1.8.13.1 error:positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute
Summary: net-fs/openafs-1.8.13.1 error:positional initialization of field in ‘struct’ ...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Cheyenne Wills
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-08 21:26 UTC by Jean-Francois Ostiguy
Modified: 2025-02-24 20:20 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge.info (emerge.info,8.40 KB, text/plain)
2025-02-08 21:27 UTC, Jean-Francois Ostiguy
Details
build.log (build.log,652.01 KB, text/plain)
2025-02-08 21:29 UTC, Jean-Francois Ostiguy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Francois Ostiguy 2025-02-08 21:26:38 UTC
Compilation fails with the following errors

k/openafs-1.8.13.1/include -I. -I.     -pthread -D_REENTRANT -DAFS_PTHREAD_ENV  -o usd_file.lo -c usd_file.c
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:46:5: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init]
   46 |     timer_seed,
      |     ^~~~~~~~~~
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:46:5: note: (near initialization for ‘hc_rand_timer_method’)
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:46:5: error: invalid initializer
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:46:5: note: (near initialization for ‘hc_rand_timer_method.<anonymous>’)
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:47:5: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init]
   47 |     timer_bytes,
      |     ^~~~~~~~~~~
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:47:5: note: (near initialization for ‘hc_rand_timer_method’)
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:47:5: error: initialization of ‘int (*)(void)’ from incompatible pointer type ‘int (*)(unsigned char *, int)’ [-Wincompatible-pointer-types]
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:47:5: note: (near initialization for ‘hc_rand_timer_method.status’)
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:48:5: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init]
   48 |     timer_cleanup,
      |     ^~~~~~~~~~~~~
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:48:5: note: (near initialization for ‘hc_rand_timer_method’)
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:48:5: error: initialization of ‘int (*)(unsigned char *, int)’ from incompatible pointer type ‘void (*)(void)’ [-Wincompatible-pointer-types]
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:48:5: note: (near initialization for ‘hc_rand_timer_method.pseudorand’)
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:49:5: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init]
   49 |     timer_add,
      |     ^~~~~~~~~
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:49:5: note: (near initialization for ‘hc_rand_timer_method’)
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:49:5: error: initialization of ‘void (*)(const void *, int)’ from incompatible pointer type ‘void (*)(const void *, int,  double)’ [-Wincompatible-pointer-types]
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:49:5: note: (near initialization for ‘hc_rand_timer_method.seed’)
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:50:5: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init]
   50 |     timer_pseudorand,
      |     ^~~~~~~~~~~~~~~~
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:50:5: note: (near initialization for ‘hc_rand_timer_method’)
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:50:5: error: initialization of ‘void (*)(const void *, int,  double)’ from incompatible pointer type ‘int (*)(unsigned char *, int)’ [-Wincompatible-pointer-types]
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:50:5: note: (near initialization for ‘hc_rand_timer_method.add’)
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:51:5: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init]
   51 |     timer_status
      |     ^~~~~~~~~~~~
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:51:5: note: (near initialization for ‘hc_rand_timer_method’)
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:51:5: error: initialization of ‘void (*)(void)’ from incompatible pointer type ‘int (*)(void)’ [-Wincompatible-pointer-types]
/var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.c:51:5: note: (near initialization for ‘hc_rand_timer_method.cleanup’)
cc1: some warnings being treated as errors
make[7]: *** [scripts/Makefile.build:229: /var/tmp/portage/net-fs/openafs-1.8.13.1/work/openafs-1.8.13.1/src/libafs/MODLOAD-6.12.9-gentoo-MP/rand-timer-kernel.o] Error 1
Comment 1 Jean-Francois Ostiguy 2025-02-08 21:27:47 UTC
Created attachment 918335 [details]
emerge.info
Comment 2 Jean-Francois Ostiguy 2025-02-08 21:29:03 UTC
Created attachment 918336 [details]
build.log
Comment 3 Cheyenne Wills 2025-02-13 22:42:42 UTC
I was able to reproduce the problem, it's related to the kernel randomized structure support.

From an upstream perspective the source file that is having problems is an "external" source that is imported into the openafs source tree and the upstream policy is that the "external" source cannot be directly modified (only refreshed from the original source).

However, looking at the original source, there are updates that correct the problem and local gentoo specific patch can be created to fix this.

I'll also need to validate that openafs doesn't have problems with randomized structure layouts when building the RPC calls.
Comment 4 Cheyenne Wills 2025-02-13 23:16:48 UTC
Will require additional patches, some will be sent to upstream as well... will take a little bit of time to work through all the updates.  Upstream openafs does have a flag to handle support for initializing structures via labels, but it's not used consistently.
Comment 5 Cheyenne Wills 2025-02-24 20:20:42 UTC
I have submitted patches to upstream that will fix this problem.  The changes won't make it into the next stable release (1.8.14) which is finishing up it's review cycle, but should be present in a future stable release.  Until that happens, I can include the commits as gentoo patches (I'm waiting for some upstream feedback first).