Source: asc
Version: 2.6.1.0-9
Severity: important
Tags: ftbfs trixie sid patch
I tried recompiling asc with libsdl1.2-compat-dev instead of
libsdl1.2-dev, in preparation for having src:sdl12-compat take over the
libsdl1.2-dev package name.
I found that asc failed to build from source in this situation:
> /bin/bash ../../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H
> -I. -I../../../.. -Wdate-time -D_FORTIFY_SOURCE=2
> -I/usr/lib/x86_64-linux-gnu/wx/include/gtk3-unicode-3.2 -I/usr/include/wx-3.2
> -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -I/usr/include/SDL
> -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -ffile-prefix-map=/home/smcv/tmp/asc=.
> -fstack-protector-strong -Wformat -Werror=format-security -std=c++11
> -Wno-sign-compare -D_UNIX_ -D_SDL_ -I/usr/include/freetype2
> -I/usr/include/libpng16 -DSIZE_T_not_identical_to_INT -c -o
> sdlmm_pixelformat.lo sdlmm_pixelformat.cpp
> In file included from sdlmm_basesurface.cpp:24:
> sdlmm_basesurface.h: In member function 'SDLmm::private_hwdata*
> SDLmm::BaseSurface::hwdata() const':
> sdlmm_basesurface.h:142:66: error: invalid conversion from 'void*' to
> 'SDLmm::private_hwdata*' [-fpermissive]
> 142 | struct private_hwdata *hwdata() const { return
> GetSurface()->hwdata; }
> |
> ~~~~~~~~~~~~~~^~~~~~
> | |
> | void*
This is because asc bundles a copy of a SDL 1.2 C++ binding, SDLmm, which
includes an unnecessary accessor for a private member of SDL_surface.
The member was declared as `struct private_hwdata *hwdata` in classic
SDL 1.2, but sdl12-compat simplifies this to `void *hwdata`.
This struct member is for internal use by SDL and the data structure
that it points to has no public definition, so there is no legitimate
reason for third-party code to be accessing it. I think the obvious
solution is to delete the accessor, instead of silencing the compiler
warning with a cast.
I reported this to https://github.com/libsdl-org/sdl12-compat/issues/299
but it's not clear to me whether it *should* be worked around in
sdl12-compat. If it isn't, then this bug is likely to become RC when
we are ready to make src:sdl12-compat take over libsdl1.2-dev.
Please consider the attached patch (it will need a trivial edit to
reference the bug number).
Thanks,
smcv
>From cb0c2c5375ab97e9b28c8ed92071f91c9192dfcd Mon Sep 17 00:00:00 2001
From: Simon McVittie <[email protected]>
Date: Tue, 27 Jun 2023 11:49:22 +0100
Subject: [PATCH] Remove unneeded accessor for SDL-internal data structure
This struct member is for internal use by SDL and the data structure
that it points to has no public definition, so there is no legitimate
reason for third-party code to be accessing it, and therefore no need
for an accessor.
The current accessor fails to compile with headers from sdl12-compat
version 1.2.64, which changed the type of the hwdata member from the
`struct private_data *` historically seen in "classic" SDL 1.2 headers
to `void *`.
Signed-off-by: Simon McVittie <[email protected]>
Bug-Debian: https://bugs.debian.org/TODO
---
source/libs/sdlmm/src/sdlmm_basesurface.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/source/libs/sdlmm/src/sdlmm_basesurface.h b/source/libs/sdlmm/src/sdlmm_basesurface.h
index a29856f..0855ac5 100644
--- a/source/libs/sdlmm/src/sdlmm_basesurface.h
+++ b/source/libs/sdlmm/src/sdlmm_basesurface.h
@@ -138,10 +138,6 @@ namespace SDLmm {
*/
const void *pixels() const { return GetSurface()->pixels; }
- //! Returns the hardware-specific surface info.
- struct private_hwdata *hwdata() const { return GetSurface()->hwdata; }
- //@}
-
//! Set the pixel to the color
/*!
\warning You can only use this function when the surface is locked.
--
2.40.1