Skip to content

xfsprogs-6.10.0: missing cast in /usr/include/xfs/xfs_fs.h(xfs_getparents_next_rec) causes error in C++ compilations

Description:

This is for informational purposes, as this is an upstream bug (though affecting Archlinux and all downstream distros as of August 29th, 2024).

Quoting the upstream kernel bug report:

C allows implicit casts from void* to any pointer type, but C++ does not. Thus, when including <xfs/xfs_fs.h> in a C++ compilation unit, the compiler raises this error:

/usr/include/xfs/xfs_fs.h: In function 'xfs_getparents_rec* xfs_getparents_next_rec(xfs_getparents*, xfs_getparents_rec*)': /usr/include/xfs/xfs_fs.h:915:16: error: invalid conversion from 'void*' to 'xfs_getparents_rec*' [-fpermissive] 915 | return next; | ^~~~ | | | void*

The return statement in xfs_getparents_next_rec() should have used an explicit cast, as the return statement in xfs_getparents_first_rec() does.

Additional info:

Steps to reproduce:

  1. Attempt to compile any code that includes /usr/include/xfs/xfs.h with a C++ compiler

I discovered this issue when attempting to recompile Ceph for boost 1.86, and after a few google searches, found the Gentoo bug report for this issue.

They seemed to have solved it for themselves via https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56527dba237030fc69ac2bb4c6725a5ac58a7e16, while they wait for the upstream to fix it.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information