Re: wxWidgets 2.9 build - Mailing list pgadmin-hackers

From Luis Ochoa
Subject Re: wxWidgets 2.9 build
Date
Msg-id AANLkTimEj5NNaKGndkxdZf2GCefDWfUim8HkVeyUan1s@mail.gmail.com
Whole thread Raw
In response to Re: wxWidgets 2.9 build  (Peter Geoghegan <peter.geoghegan86@gmail.com>)
List pgadmin-hackers
I believe this warning is because something simple, try to verify that pointer is set before using for evaluation of an expression, in other words (example warning at gqb/gqbViewPanels.cpp:211)

(add if expression before using gModel...)

        if(gModel)  or if(gModel!=NULL) ....  gModel->changesPositions(selTop,selTop--);

that help you to verify that pointer is not null before using it. I don't test/try this solution because at my compiler that warning is not shown, but I believe is going to work.

Here's another warning of interest that I haven't been able to fix yet:

./gqb/gqbViewPanels.cpp: In member function ‘void
gqbGridPanel::OnButtonUp(wxCommandEvent&)’:
./gqb/gqbViewPanels.cpp:211:45: warning: operation on
‘((gqbGridPanel*)this)->gqbGridPanel::selTop’ may be undefined
./gqb/gqbViewPanels.cpp: In member function ‘void
gqbGridPanel::OnButtonDown(wxCommandEvent&)’:
./gqb/gqbViewPanels.cpp:292:45: warning: operation on
‘((gqbGridPanel*)this)->gqbGridPanel::selTop’ may be undefined
./gqb/gqbViewPanels.cpp: In member function ‘void
gqbOrderPanel::OnButtonUp(wxCommandEvent&)’:
./gqb/gqbViewPanels.cpp:1133:59: warning: operation on
‘((gqbOrderPanel*)this)->gqbOrderPanel::selRightTop’ may be undefined
./gqb/gqbViewPanels.cpp: In member function ‘void
gqbOrderPanel::OnButtonDown(wxCommandEvent&)’:
./gqb/gqbViewPanels.cpp:1214:59: warning: operation on
‘((gqbOrderPanel*)this)->gqbOrderPanel::selRightTop’ may be undefined

Basically, if you read a variable twice in an expression where it is
also written to, the result is undefined. See
http://www2.research.att.com/~bs/bs_faq2.html#evaluation-order for
more information. My problem here is that the evaluation order isn't
just undefined to the compiler :-)



Regards, Luis.

pgadmin-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: wxWidgets 2.9 build
Next
From: Peter Geoghegan
Date:
Subject: Re: wxWidgets 2.9 build