Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Base Exception class behavior change
Base Exception class behavior change [message #42886] Sun, 13 April 2014 13:37 Go to next message
hans is currently offline  hans
Messages: 44
Registered: March 2006
Location: Germany
Member
After moving the "Exc" exception class to value.h
the default ctor for this class was changed.

Before it had set the String to the last error code message, now it will be left empty.

I do not know if this exposes a bug or was intentionally, but perhaps someone can explain the rationale to do so.

Also I really would love to see the "Exc" class in another header Razz

THX, Hans
Re: Base Exception class behavior change [message #42890 is a reply to message #42886] Sun, 13 April 2014 19:47 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
hans wrote on Sun, 13 April 2014 11:37
After moving the "Exc" exception class to value.h
the default ctor for this class was changed.

Before it had set the String to the last error code message, now it will be left empty.

I do not know if this exposes a bug or was intentionally, but perhaps someone can explain the rationale to do so.

Also I really would love to see the "Exc" class in another header Razz

THX, Hans


OK, moving Exc to Defs.h.

Setting OS last error in default constructor was forgotten sin of long past, that is why it was removed.

Mirek
Re: Base Exception class behavior change [message #42893 is a reply to message #42890] Sun, 13 April 2014 19:53 Go to previous messageGo to next message
hans is currently offline  hans
Messages: 44
Registered: March 2006
Location: Germany
Member
Thank you, Mirek.

I'm also not a fan of automatically use the GetLastError() code for setting the OS last error in default constructor of exception so I can go with it.

Was only wondering if some dependency was broken.
Re: Base Exception class behavior change [message #42894 is a reply to message #42893] Sun, 13 April 2014 19:56 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
hans wrote on Sun, 13 April 2014 17:53
Thank you, Mirek.

I'm also not a fan of automatically use the GetLastError() code for setting the OS last error in default constructor of exception so I can go with it.

Was only wondering if some dependency was broken.


In theory, it is possible, but as the error string provided by default constructor was always useless, I doubt it. I think the cleanup is worth the risk here.
Re: Base Exception class behavior change [message #42903 is a reply to message #42890] Sun, 13 April 2014 21:27 Go to previous message
mingodad is currently offline  mingodad
Messages: 53
Registered: February 2008
Location: Spain
Member
With the last changes building anything is broke.
------
c++ -c -I"/home/mingo/MyApps" -I"/home/mingo/upp/uppsrc" -I"/usr/include/gtk-2.0" -I"/usr/lib/x86_64-linux-gnu/gtk-2.0/include" -I"/usr/include/atk-1.0" -I"/us
r/include/cairo" -I"/usr/include/gdk-pixbuf-2.0" -I"/usr/include/pango-1.0" -I"/usr/include/gio-unix-2.0/" -I"/usr/include/glib-2.0" -I"/usr/lib/x86_64-linux-gn
u/glib-2.0/include" -I"/usr/include/pixman-1" -I"/usr/include/freetype2" -I"/usr/include/libpng12" -I"/usr/include/freetype2" -I"/usr/include/gtk-2.0" -I"/usr/i
nclude/glib-2.0" -I"/usr/lib/glib-2.0/include" -I"/usr/lib/gtk-2.0/include" -I"/usr/include/cairo" -I"/usr/include/pango-1.0" -I"/usr/include/atk-1.0" -I"/usr/X
11R6/include" -I"/usr/X11R6/include/freetype2" -I"/usr/X11R6/include/gtk-2.0" -I"/usr/X11R6/include/glib-2.0" -I"/usr/X11R6/lib/glib-2.0/include" -I"/usr/X11R6/
lib/gtk-2.0/include" -I"/usr/X11R6/include/cairo" -I"/usr/X11R6/include/pango-1.0" -I"/usr/X11R6/include/atk-1.0" -I"/usr/include/gdk-pixbuf-2.0" -DflagMT -Dfla
gSSE2 -DflagGCC -DflagDEBUG -DflagSHARED -DflagDEBUG_FULL -DflagBLITZ -DflagLINUX -DflagPOSIX -DbmYEAR=2014 -DbmMONTH=4 -DbmDAY=13 -DbmHOUR=20 -DbmMINUTE=28 -Db
mSECOND=52 -ggdb -g2 -fexceptions -msse2 -mfpmath=sse -D_DEBUG -O0 -x c++ "/home/mingo/upp/uppsrc/Skylark/StdLib.icpp" -o "/home/mingo/.upp/_out/MyApps/Skyla
rk/GCC.Debug.Debug_Full.Mt.Shared.Sse2/StdLib.o"
In file included from /home/mingo/upp/uppsrc/Core/Core.h:244:0,
from /home/mingo/upp/uppsrc/Sql/Sql.h:4,
from /home/mingo/upp/uppsrc/Skylark/Skylark.h:4,
from /home/mingo/upp/uppsrc/Skylark/App.cpp:1,
from /home/mingo/.upp/_out/MyApps/Skylark/GCC.Debug.Debug_Full.Mt .Shared.Sse2/$blitz.cpp:3:
/home/mingo/upp/uppsrc/Core/Defs.h:794:27: error: expected class-name before '{' token
class Exc : public String {
^
/home/mingo/upp/uppsrc/Core/Defs.h:797:12: error: 'String' does not name a type
Exc(const String& desc) : String(desc) {}
^
/home/mingo/upp/uppsrc/Core/Defs.h:797:20: error: ISO C++ forbids declaration of 'desc' with no type [-fpermissive]
Exc(const String& desc) : String(desc) {}

[Updated on: Sun, 13 April 2014 21:29]

Report message to a moderator

Previous Topic: AMap's FindAdd, FindPut API changed
Next Topic: ThrowValueTypeError small bug, and suggestion for removing it
Goto Forum:
  


Current Time: Fri Apr 19 05:03:25 CEST 2024

Total time taken to generate the page: 0.04107 seconds