[Qt-interest] QDebugStream quit working with Qt 4.8.0-rc1 and new compiler

K. Frank kfrank29.c at gmail.com
Mon Oct 31 01:26:31 CET 2011


Hi Thiago!

Thank you for your comments.

On Sun, Oct 30, 2011 at 7:39 PM, Thiago Macieira <thiago at kde.org> wrote:
> On Sunday, 30 de October de 2011 23:35:29 Andreas Pakulat wrote:
>> Since gcc 4.7.0 is not even released yet and as far as I understand
>> still in 'feature-development' stage I'd currently bet on your
>> gcc-upgrade causing the problem.
>
> And I'd also say that testing gcc 4.7.0 on a more "supported" platform like
> Linux would be recommended. (supported by GCC developers)

Yes, this is certainly a worthwhile suggestion.  Unfortunately, I don't
currently have access to a linux platform.

> When I tried to build Qt with gcc 4.6.0 on Windows (mingw), I had to apply
> patches to make it work.

I will note that my build of Qt 4.8.0-rc1 with the 64-bit mingw-w64 4.7.0
compiler went altogether quite smoothly.  (I had to patch the compiler's
pthread.h in order to get qdatetime.cpp to compile.  Also, starting the
build with about 2 GB of memory free led to a "Memory exhausted" error.
Re-running the build with 3 GB free succeeded.  One very minor patch
to qwt, to fix a 32-bit --> 64-bit issue, was also required.)

I then built a moderately complex desktop application (it uses QwtPlot
and QThread) without incident.  It ran perfectly except for the QDebugStream
issue.

> Also, there's another variable you may have failed to consider: this
> QDebugStream class. I was baffled for a moment trying to understand how your
> code might work, until I reread and noticed "that I downloaded from the list
> archive". That class may be buggy and relying on undocumented behaviour of
> either Qt or iostream. Before you cry wolf on either Qt or GCC, please ensure
> that the code there is correct.

Well, that's part of the reason I included the QDebugStream code in my
post.  The code is small and pretty simple.  When I look at it, it looks
correct, but I could easily be overlooking something.  It only uses Qt by
way of QTextEdit, which is uses very simply, and, as far as I can see,
not in any undocumented way.  It uses iostream's basic_streambuf,
which I'm no expert on, but again, as far as I can tell, it's using it
correctly.

I certainly don't mean to come across as "crying wolf."  I'm just asking
whether anyone has any experience or insights it might be helpful to
share.

For example, it looks like there's a certain amount of usage of QDebugStream
in the community -- not just me.  Perhaps someone has used it successfully
with the 4.7.0 compiler, or perhaps with Qt 4.8.0-rc1.  Or perhaps someone
has seen problems similar to what I see.

I'm just throwing it out there.  Maybe somebody's seen something similar,
or has some suggestions.

> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>   Software Architect - Intel Open Source Technology Center

Best regards.


K. Frank



More information about the Qt-interest-old mailing list