|
From: Wei D. <wd...@Pr...> - 2007-01-23 14:14:41
|
I get your point. Then I think the current code is OK. I prefer "chk" to save a few key strokes. Regarding to the mailing list, have you received the confirmation email after subscription and replied it? - Wei Cucinotta Tommaso wrote: > I see you got the point in the existence of the various > macro. You're right, assertions are supposed to be used to > detect programming errors during development, therefore > they are optimized away in final releases (with a debug > level supposedly lower than DEBUG), while checks are > supposed to remain in production state, therefore there > are various actions undertakable when such conditions are > detected: > > - oml_check_exit: exit the program if condition not > satisfied > (for fast prototyping, not to be used in final > programs) > - oml_check_go: go to label if condition not satisfied > (typically at an error-recovery point) > - oml_check_ret: return a specified value if condition not > satisfied > > Maybe 'check' may be used in place of 'chk' for clarity > and uniformity with 'assert' macros. > > Whether to leave assertion expansion/elimination under the > control of the debugging level is still a mystery to me: > could it be meaningful to separate the two concepts ? > (adding sensitivity to a OML_ASSERT_ENABLED define). > > Couldn't figure out what's going on yet, but I don't > receive any message from the list, thus I'm reading from > the on-line archives :-(. Tried options, subscribe, > unsubscribe, resubscribe, no way. > > Bye, > > T. > > The web site is very nice. > > I just realized a possible bug in the Syntax Quick Tour. > Statements > like the following are used very often > > oml_assert_ok(oml_vector_init(&v, 16)); > > However, when you disable assert, the vector init code is > optimized > out. I think oml_chk_exit might be > more suitable. I'm wondering if it's appropriate to make > assert > generate the tested code even if assert is > disabled. > > BTW, I've signed up for the mailing list. So please just > send emails to > the mailing list. > > Best, > > - Wei > > I've signed up for the mailing list, so please send the > further > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Oml-devel mailing list > Oml...@li... > https://lists.sourceforge.net/lists/listinfo/oml-devel > |