On 10/08/06, Robert Story <[EMAIL PROTECTED]> wrote: > So, if dave saw an assert, it's because he asked for it. If he saw a crash, > then the default logging part of the netsnmp_assert macro might need tweaking.
I can't remember the exact scenario now - it was a while ago. It might have aborted the program, or it might have issued a meaningless error message. All I remember is that "something bad happened", with no clear indication as to what, and that I got very confused when chasing it down. When I finally got to the bottom of things, I logged the bug rather than removing the code immediately, in the hope of getting an explanation - trying to be cooperative for once :-) I'm not sure why I decided on a bug rather than a post to the mailing list - it appears I may have made the worst choice of the three. Sorry. > WH> Especially since the code right above > WH> it makes the assert always trigger..... > WH> A minimum it should have a comment above it saying you > WH> expect it always to hit. > > Ok, i'm fine w/a comment that it's always expected to hit. That's the *absolute* minimum for something like this IMO. The whole point of assertions (AIUI) is that they should normally be true. So an assertion that is trivially false is very confusing. Hence the subject of the bug in question. > The other case where I like netsnmp_asserts is anyplace in the code that I > happen to run across that doesn't have error handling, or where I think a > certain condition would cause bad things to happen. Often this will happen in > code that I'm not very familiar with, or while I'm working on something else > and don't have time for a detailed investigation. That's fair enough. I can see the value of netsnmp_assert as a stop-gap error message - particularly if there isn't the time to do things "properly". But the aim should be to replace such assertions with a more meaningful error message (or proper full-scale error handling). I've now done so for this particular situation. Dave ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
