[Debian-med-packaging] Bug#1021394: C++ help needed

Aaron M. Ucko ucko at debian.org
Fri Apr 14 14:37:59 BST 2023


tags 1034369 + patch
thanks

Andreas Tille <andreas at an3as.eu> writes:

> I guess the fix will boil down to a type casting in this line
>
>   https://salsa.debian.org/med-team/libcereal/-/blob/master/unittests/map.hpp#L65
> 
>      o_esplmap.insert({random_value<char>(gen),  { random_value<int>(gen), random_value<int>(gen) }});
>
> unfortunately my C++ knowledge is too limited to know whether it is
> really that simple nor how exactly this line needs to be fixed.  The fix
> should be tested at least on arm64 (since the test passes on amd64).

#1034369 looks very similar to #1021394, which worked around
corresponding build-time errors by disabling -Werror but I see left the
autopkgtest's cmake invocation as is; there may be merit in disabling
-Werror on that front too.  At any rate, I would recommend properly
addressing the compiler's concerns by changing random_value<char> to
random_value<int8_t> here and in the other unittests/*map.hpp headers to
match the corresponding containers' declarations, per the attached
patch.  The relevant platform difference is whether plain char is
signed, as it notably is on x86 but not arm*.  (There are other
architectures in each camp.)

-- 
Aaron M. Ucko, KB1CJC (amu at alum.mit.edu, ucko at debian.org)
http://www.mit.edu/~amu/ | http://stuff.mit.edu/cgi/finger/?amu@monk.mit.edu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: allow_unsigned_char.patch
Type: text/x-diff
Size: 2330 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-med-packaging/attachments/20230414/6c22968f/attachment-0003.patch>


More information about the Debian-med-packaging mailing list