[PATCH] alpha: Remove anonymous union in struct stat [BZ #27042]
Matt Turner
mattst88@gmail.com
Thu Dec 10 01:25:08 GMT 2020
On Wed, Dec 9, 2020 at 12:11 PM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Matt Turner via Libc-alpha:
>
> > This is clever, but it confuses downstream detection in at least zstd
> > and GNOME's glib. zstd has preprocessor tests for the 'st_mtime' macro,
> > which is not provided by the path using the anonymous union; glib checks
> > for the presence of 'st_mtimensec' in struct stat but then tries to
> > access that field in struct statx (which might be a bug on its own).
>
> A more conservative approach would be adding
>
> #define st_atime st_atime
> #define st_ctime st_ctime
> #define st_mtime st_mtime
>
> to the anonymous union case.
Thanks. That works for zstd, but not for glib—which might be a bug in
glib, like I mentioned. I'll investigate that independently.
Andreas immediately closed the bug I filed with the message
> The existence of the st_?time macros is an implementation detail.
and I have no doubt that he's correct, but it appears that all or
basically all of the architectures' headers provide these macros so
I'd prefer to bring alpha in line rather than convince multiple
projects that their code is technically wrong in a way that only
manifests on an architecture they've never heard of.
v2 sent that deals with the kernel_stat.h interactions.
More information about the Libc-alpha
mailing list