|
From: | John W. Eaton |
Subject: | Re: This doesn't look right |
Date: | Mon, 25 Jan 2016 15:16:20 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 |
On 01/25/2016 02:59 PM, John W. Eaton wrote:
On 01/25/2016 01:00 PM, Carnë Draug wrote:On 20 January 2016 at 00:40, Rik <address@hidden> wrote:
The second oddity is in event-queue.h class event_queue_safe : public event_queue { private: static void gripe_exception (void); This private function has a prototype, but no implementation anywhere. If this is really meant to be a do-nothing function then it should at least have a comment to that effect. Anyone know why this is the way it is?hg blame tells me it was added in 1054ab58cd58 [2] but again, there isn't many comments. However, looking at the rest of the commit it seems to be copied code from unwind_protect_safe (compare with [3]) so maybe it was just a copy and paste mistake?Yes, it looks like a copy and paste mistake. I'm pretty sure we don't want exceptions to be thrown when we are already inside a destructor, so I guess this should just be a warning, and we should change the one in unwind_protect_safe as well.
I don't understand why there isn't a link error if there is no implementation of gripe_exception.
I'm not sure why these functions are declared static. That doesn't seem necessary in this case. Or that they even need to be members of the class. It seems to me that we could just have a generic "warn_unhandled_exception_in_destructor" function.
It does seem better to me to at least issue a warning rather than silently ignoring the exception. But maybe there is a reason to silently ignore it instead? I don't know.
jwe
[Prev in Thread] | Current Thread | [Next in Thread] |