Bug#327021: libqt3-mt: QString::arg(double) produces sometimes garbage
Package: libqt3-mt
Version: 3:3.3.4-7
Severity: important
A simple conversion of a double value into a QString with the standard
QString::arg(...) function fails sometimes:
--------------- code to reproduce bug ------------
#include <qstring.h>
#include <qregexp.h>
#include <stdio.h>
int main (int argc, char* argv[])
{
double myValue = 13.0;
QString convertedFloat = QString ("%1\n").arg ((double) myValue, 0, 'g', 7);
printf ("Converted value: %s\n", convertedFloat.latin1 ());
QRegExp unallowedChars ("[a-zA-Z,;'<>?:\"!@#$%^&*()-_+]");
if (convertedFloat.contains (unallowedChars) > 0)
{
printf ("BUG: The conversion of a double failed.\n");
return 1;
}
return 0;
}
--------------- end of code to reproduce bug ------------
Because there are no differences between the debian version of
qstring.cpp and qlocale.cpp and the corresponding qt versions and
because I got no problems when compiling the same version with a g++
of 3.3 or earlier I would not be surprised if it turns out to be a
compiler bug of the gcc-3.4 and higher.
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11-1-686-smp
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages libqt3-mt depends on:
ii fontconfig 2.3.2-1 generic font configuration library
ii libaudio2 1.7-3 The Network Audio System (NAS). (s
ii libc6 2.3.5-6 GNU C Library: Shared libraries an
ii libfontconfig1 2.3.2-1 generic font configuration library
ii libfreetype6 2.1.10-1 FreeType 2 font engine, shared lib
ii libgcc1 1:4.0.1-6 GCC support library
ii libice6 6.8.2.dfsg.1-6 Inter-Client Exchange library
ii libjpeg62 6b-10 The Independent JPEG Group's JPEG
ii libmng1 1.0.8-1 Multiple-image Network Graphics li
ii libpng12-0 1.2.8rel-1 PNG library - runtime
ii libsm6 6.8.2.dfsg.1-6 X Window System Session Management
ii libstdc++6 4.0.1-6 The GNU Standard C++ Library v3
ii libx11-6 6.8.2.dfsg.1-6 X Window System protocol client li
ii libxcursor1 1.1.3-1 X cursor management library
ii libxext6 6.8.2.dfsg.1-6 X Window System miscellaneous exte
ii libxft2 2.1.7-1 FreeType-based font drawing librar
ii libxinerama1 6.8.2.dfsg.1-6 X Window System multi-head display
ii libxrandr2 6.8.2.dfsg.1-6 X Window System Resize, Rotate and
ii libxrender1 1:0.9.0-2 X Rendering Extension client libra
ii libxt6 6.8.2.dfsg.1-6 X Toolkit Intrinsics
ii xlibs 6.8.2.dfsg.1-6 X Window System client libraries m
ii zlib1g 1:1.2.3-4 compression library - runtime
libqt3-mt recommends no packages.
-- no debconf information
Reply to: