On 2021-04-15 16:49 +0100, John Burrell via blfs-dev wrote: > On Thu, 15 Apr 2021 at 15:25, Xi Ruoyao via blfs-dev > <blfs-dev@lists.linuxfromscratch.org> wrote: > > > > On 2021-04-15 10:43 +0100, John Burrell via blfs-dev wrote: > > > On Sat, 10 Apr 2021 at 16:10, Xi Ruoyao via blfs-dev > > > <blfs-dev@lists.linuxfromscratch.org> wrote: > > > > > > > > On 2021-04-10 15:05 +0100, John Burrell via blfs-dev wrote: > > > > > Using the systemd version of the development book, libblockdev-2.25 > > > > > gives: > > > > > > > > > > vdo.c: In function ‘bd_vdo_stats_copy’: > > > > > vdo.c:84:5: error: ‘g_memdup’ is deprecated: Use 'g_memdup2' instead > > > > > [-Werror=deprecated-declarations] > > > > > 84 | return g_memdup (stats, sizeof (BDVDOStats)); > > > > > | ^~~~~~ > > > > > In file included from /usr/include/glib-2.0/glib.h:82, > > > > > from vdo.c:20: > > > > > /usr/include/glib-2.0/glib/gstrfuncs.h:257:23: note: declared here > > > > > 257 | gpointer g_memdup (gconstpointer mem, > > > > > | ^~~~~~~~ > > > > > cc1: all warnings being treated as errors > > > > > > > > > > I didn't see a way to stop warnings being treated as errors in the > > > > > configure script. I tried -Wno-error=deprecated-declarations, but that > > > > > didn't work, so I added > > > > > > > > > > CFLAGS=-Wno-error > > > > > > > > > > to the configure command to allow it to compile. > > > > > > > > sed 's/g_memdup/g_memdup2/' makes more sense. g_memdup is deprecated > > > > because > > > > using it may cause security issues and there is no way to fix without > > > > changing > > > > the API. > > > > -- > > > > Xi Ruoyao <xry...@mengyan1223.wang> > > > > School of Aerospace Science and Technology, Xidian University > > > > > > I now have glib-2.66.8 installed and this seems to fix the problem > > > with g_memdup in libblockdev-2.25 > > > I assume that this is also the case with the latest version, > > > glib-2.68.1, but I haven't tried it yet. > > > It would appear that the sed in libblockdev-2.25 is no longer required > > > and in fact now causes the compile to fail if included. > > > > Negative. It's not a "fix". It's just g_memdup is deprecated *since* 2.68. > > > > g_memdup is insecure by its nature. Any new code should use g_memdup2 > > instead. > > -- > > Xi Ruoyao <xry...@mengyan1223.wang> > > School of Aerospace Science and Technology, Xidian University > > Have you tried compiling libblockdev-2.25 with the sed in there and > with glib-2.68.1 > because it doesn't work with glib-2.66.8?
I just tried again. No issue. The sed command is: sed 's/g_memdup/&2/' -i \ src/lib/plugin_apis/vdo.{c,api} \ src/plugins/vdo.c It won't work for 2.66.8: in 2.66.6 g_memdup2 was added, but as a private symbol. ref: https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 -- Xi Ruoyao <xry...@mengyan1223.wang> School of Aerospace Science and Technology, Xidian University -- http://lists.linuxfromscratch.org/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page