Bug#689569: Unchecked implicit conversion from float to enum

Michael Tautschnig mt at debian.org
Thu Oct 4 06:13:40 UTC 2012


Package: openarena
Version:

While building the package using our research compiler infrastructure we noticed
the following unchecked implicit conversion with possibly undefined behaviour:

Lines 401-403 of code/q3_ui/ui_playermodel.c:

        qboolean precache;

        precache = trap_Cvar_VariableValue("com_buildscript");

The conversion of an arbitrary float value to an enum (qboolean) isn't
well-defined.

Likely the best fix is to change the right-hand side to a comparison to
non-zero:

        precache = trap_Cvar_VariableValue("com_buildscript") != 0;

Best,
Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-games-devel/attachments/20121004/ad364d6a/attachment.pgp>


More information about the Pkg-games-devel mailing list