1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 <2011> 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 <2011> 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: caGateway crashes / use of *MustSucceed functions |
From: | Dirk Zimoch <[email protected]> |
To: | Andrew Johnson <[email protected]> |
Cc: | [email protected] |
Date: | Thu, 19 May 2011 13:34:35 +0200 |
Andrew Johnson wrote:
[...], but assert() calls may legally appear in places where the assertion can only fire if there is a real bug in the code.
I agree. That's exactly my point. Assertions should fire on programming errors, but not on run-time problems like unavailable memory.
So calling assert() on the result of epicsEventWait() is OK because that only fails if the event id is invalid which is a programming error. Calling assert on the result of epicsEventCreate() is not OK.
Dirk