Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Conditional jump or move depends on uninitialised value(s)
|
|
|
|
Re: Conditional jump or move depends on uninitialised value(s) [message #19849 is a reply to message #19843] |
Tue, 27 January 2009 06:06   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
Thanks. All reported uninitialised values are gone.
luzr wrote on Mon, 26 January 2009 11:29 | Interesting.
theide not working in win64, that is a new one... Going to check it soon - have not for a while.
|
I got XP x64 in my current company and tried to build and use 64-bit version of TheIDE. I managed to build and launch it, but got no luck with putting brackpoints.
I'll try to check that again tomorrow.
Quote: |
OTOH, I am using Ubuntu64 for all Linux development, booting Ubuntu32 really rarely (about as often as Vista64) - have not noticed any problems at all.
What packages is your app using?
Mirek
|
After fixing all issues with Draw and SQL the only problem I'm seeing is with GridCtrl. But this is another story.
Another useful fix. This is an uninitialized value too. Using of initialization lists is a good practice ...
Index: uppsrc/Core/Gtypes.h
===================================================================
--- uppsrc/Core/Gtypes.h (revision 812)
+++ uppsrc/Core/Gtypes.h (working copy)
@@ -60,7 +60,7 @@
String ToString() const;
- Size_() {}
+ Size_() : cx(0), cy(0) {}
Size_(T cx, T cy) : cx(cx), cy(cy) {}
Size_(const Size_<int>& sz) : cx((T)sz.cx), cy((T)sz.cy) {}
Regards,
Novo
[Updated on: Tue, 27 January 2009 06:08] Report message to a moderator
|
|
|
Re: Conditional jump or move depends on uninitialised value(s) [message #19852 is a reply to message #19849] |
Tue, 27 January 2009 10:25   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
Novo wrote on Tue, 27 January 2009 00:06 | Thanks. All reported uninitialised values are gone.
luzr wrote on Mon, 26 January 2009 11:29 | Interesting.
theide not working in win64, that is a new one... Going to check it soon - have not for a while.
|
I got XP x64 in my current company and tried to build and use 64-bit version of TheIDE. I managed to build and launch it, but got no luck with putting brackpoints.
|
Ah, well. Debugger not working, that is expected, at least sort of. Some more work is needed there.
Index: uppsrc/Core/Gtypes.h
===================================================================
--- uppsrc/Core/Gtypes.h (revision 812)
+++ uppsrc/Core/Gtypes.h (working copy)
@@ -60,7 +60,7 @@
String ToString() const;
- Size_() {}
+ Size_() : cx(0), cy(0) {}
Size_(T cx, T cy) : cx(cx), cy(cy) {}
Size_(const Size_<int>& sz) : cx((T)sz.cx), cy((T)sz.cy) {}
Well, that is how it is meant to be. If you do not initialize Size, it is not initialized...
The point is
Buffer<Size> x(1000);
I might not want to have implicit memset(&x, 0, 4000) - what if I know I am going to change these sizes immediately to something else?
Mirek
|
|
|
|
Re: Conditional jump or move depends on uninitialised value(s) [message #19869 is a reply to message #19866] |
Wed, 28 January 2009 09:46   |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
I personally don't think this is a major issue:
1) All Upp 'basic' types (those with public member variables, Point_, Rect_ etc) exibit the same behaviour, so you only have to learn it once.
2) C++ convention is that variables are uninitialised, so you should be aware of the issue already. Buffer<int> x(2000); would be just as uninitialised.
On the other hand, in probably 99.9% of cases initialisation would be safer and come without any practical performance consequences.
Perhaps there is a case for having initialisation on by default, but available to be switched off with a compiler flag for those who really care?
[Updated on: Wed, 28 January 2009 09:50] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 17:44:56 CEST 2025
Total time taken to generate the page: 0.01137 seconds
|