Home » U++ Library support » U++ Core » BETA status handling
BETA status handling [message #52397] |
Wed, 18 September 2019 15:18 |
|
koldo
Messages: 3394 Registered: August 2008
|
Senior Veteran |
|
|
Hello all
When having an application in beta status, there is a big risk of having ASSERTs called in Release mode binaries.
I propose you to add a new flag like BETA, so the ASSERT could be reconverted into throw Exc() or other way so that the software can handle the error, instead of just crashing abruptly the software. Last is a terrible user experience.
What do you think?
Best regards
Iñaki
|
|
|
|
Re: BETA status handling [message #52400 is a reply to message #52398] |
Wed, 18 September 2019 17:26 |
|
koldo
Messages: 3394 Registered: August 2008
|
Senior Veteran |
|
|
This is the reason I propose an intermediate BETA status, where ASSERTs could be handled by software trying to catch the problems.
In beta, after an ASSERT, a warning window is ugly, but a software crash is much worse.
Best regards
Iñaki
[Updated on: Wed, 18 September 2019 17:27] Report message to a moderator
|
|
|
|
Re: BETA status handling [message #52402 is a reply to message #52401] |
Wed, 18 September 2019 18:47 |
|
koldo
Messages: 3394 Registered: August 2008
|
Senior Veteran |
|
|
That could be great.
It could catch all ASSERT and panic conditions that cost time to be checked (and are void in Release mode), to throw something to be catch at higher level.
This could be set by a flag, so normal Release binaries would not suffer the drawback of, for example, having to check the bounds of any access to a container.
Best regards
Iñaki
[Updated on: Wed, 18 September 2019 18:48] Report message to a moderator
|
|
|
|
Re: BETA status handling [message #52478 is a reply to message #52466] |
Sun, 06 October 2019 13:56 |
|
koldo
Messages: 3394 Registered: August 2008
|
Senior Veteran |
|
|
Thank you Mirek. However that is not exactly the same.
InstallPanicMessageBox() and SetAssertFailedHook() let to install panic handlers.
However, in case of the ASSERTs, this only works in DEBUG mode. Please check this code in Defs.h:
#ifdef _DEBUG
#define ASSERT_(x, msg) ((x) ? (void)0 : ::Upp ::AssertFailed(__FILE__, __LINE__, msg))
#define ASSERT(x) ASSERT_(x, #x)
#else
inline void LOGNOP__() {}
#define LOG_NOP Upp::LOGNOP__()
#define ASSERT_(x, msg) LOG_NOP
#define ASSERT(x) LOG_NOP
#endif Out of DEBUG, ASSERTs seem to do nothing, as are disconnected to AssertFailed().
Best regards
Iñaki
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Sep 21 01:53:19 CEST 2024
Total time taken to generate the page: 0.03841 seconds
|