Opened 11 years ago

Closed 11 years ago

#39625 closed defect (fixed)

qt4-mac: compilation warning "field 'd' is uninitialized when used here"

Reported by: mojca (Mojca Miklavec) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: qt4-mac

Description

This is probably an upstream problem, but I only started experiencing it recently with a variety of programs compiled against Qt4 (you can test with gnuplot +qt for example). Maybe because I upgraded Xcode ...

In file included from /opt/local/include/QtCore/QtCore:12:
In file included from /opt/local/include/QtCore/qdatetime.h:47:
In file included from /opt/local/include/QtCore/qsharedpointer.h:50:
/opt/local/include/QtCore/qsharedpointer_impl.h:595:43: warning: field 'd' is uninitialized when used here [-Wuninitialized]
    inline QWeakPointer(X *ptr) : d(ptr ? d->getAndRef(ptr) : 0), value(ptr)
                                          ^
1 warning generated.

It would be great to check with the upstream and report it if needed. (Feel free to close the ticket if it doesn't seem important.)

Change History (8)

comment:1 Changed 11 years ago by michaelld (Michael Dickens)

With Qt 4.8.5 now as qt4-mac, is this still an issue? You'll need to do:

sudo port selfupdate
sudo port clean qt4-mac

and then try installing it again. I already had "gnuplot +qt" installed; I'll try removing that and reinstalling it.

comment:2 Changed 11 years ago by michaelld (Michael Dickens)

"gnuplot +qt" works for me; it did before, too. Maybe this is an issue with something else? I'll await your reply before trying anything more.

comment:3 Changed 11 years ago by mojca (Mojca Miklavec)

Are you saying that it works or that compilation doesn't result in any warnings? (I didn't say that it didn't work at all, but it was complaining during compilation of most Qt software.)

Where can I get version 4.8.5 (and 5 :)?

comment:4 Changed 11 years ago by michaelld (Michael Dickens)

I'm saying that doing "sudo port install gnuplot +qt" works without error. Then when I start Octave I do:

graphics_toolkit gnuplot
plot(1:10)

and that works too. Since I installed octave +fltk, I can also do:

graphics_toolkit fltk
plot(1:10)

and that works as well. I'm not sure how to tell gnuplot to use Qt when called from Octave. Right now, it uses AquaTerm.app from MacPorts.

comment:5 Changed 11 years ago by michaelld (Michael Dickens)

You can get Qt 4.8.5 from the latest qt4-mac:

sudo port selfupdate
sudo port upgrade qt4-mac

should do the trick.

comment:6 in reply to:  4 Changed 11 years ago by mojca (Mojca Miklavec)

Replying to michaelld@…:

I'm not sure how to tell gnuplot to use Qt when called from Octave. Right now, it uses AquaTerm.app from MacPorts.

You have the following options:

  • Install gnuplot +qt -aquaterm (probably the easiest)
  • define GNUTERM environmental variable to qt
  • inside octave: setenv("GNUTERM", "qt")
  • I need to check it out, but I believe that putting GNUTERM to .gnuplot or something along that lines also works
  • hardcoding default terminal to gnuplot binary (see #35616)

As to the last point, now you have

Variants: [+]aquaterm, emacs, [+]luaterm, no_x11,
          old_bitmap_terminals, [+]pangocairo, qt, universal,
          wxwidgets, wxwidgets_devel, [+]x11

and then one would end up with

Variants: [+]aquaterm, [+]default_aquaterm, default_qt, default_wxt,
          default_x11, emacs, [+]luaterm, no_x11,
          old_bitmap_terminals, [+]pangocairo, qt, universal,
          wxwidgets, wxwidgets_devel, [+]x11

But again: qt itself works (there are some problems unrelated to this issue), it only throws warnings during compilation.

However, sudo port selfupdate doesn't want to update the port definition to version 4.8.5. That's odd.

comment:7 Changed 11 years ago by mojca (Mojca Miklavec)

I added files for qt4-mac to local repository and it seems that the warnings are gone. (There are a bunch of other warnings though which came with the new compiler, unrelated to Qt.) I believe the ticket can be closed.

comment:8 Changed 11 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: newclosed

It seems as though "selfupdate"s rsync is not working reliably, so downloading from SVN or directly from macports.org is the way to go. I'm glad to hear that the update worked.

Setting "setenv("GNUTERM", "qt")" inside octave does the trick! Cool. I had no idea. I'm just a casual octave user, really.

Note: See TracTickets for help on using tickets.