From: SourceForge.net <no...@so...> - 2007-03-24 19:25:27
|
Bugs item #1686528, was opened at 2007-03-23 07:34 Message generated for change (Comment added) made by maartenbrock You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1686528&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Run Time Library >Group: fixed >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) >Assigned to: Maarten Brock (maartenbrock) Summary: assert.h doesn't check for NDEBUG macro Initial Comment: Current device/include/assert.h header (r4709) doesn't check for NDEBUG macro, which is required by ANSI C. You can find the patch below. Note that I have also removed header guard because, according to C standard, "assert macro is redefined according to the current state of NDEBUG each time that <assert.h> is included." Index: ChangeLog =================================================================== --- ChangeLog (revision 4709) +++ ChangeLog (working copy) @@ -1,3 +1,8 @@ +2007-03-23 Alexey Shamrin <shamrin AT gmail.com> + * device/include/assert.h: + made assert.h header ANSI compliant (added a check for NDEBUG macro, + removed header guard) + 2007-03-22 Borut Razem <borut.razem AT siol.net> * debugger/mcs51/cmd.c, debugger/mcs51/sdcdb.c: Index: device/include/assert.h =================================================================== --- device/include/assert.h (revision 4709) +++ device/include/assert.h (working copy) @@ -22,11 +22,13 @@ what you give them. Help stamp out software-hoarding! -------------------------------------------------------------------------*/ -#ifndef SDCC_ASSERT_H -#define SDCC_ASSERT_H +#undef assert +#ifdef NDEBUG +/* Debugging disabled -- do not evaluate assertions. */ +#define assert(x) ((void)0) +#else +/* Debugging enabled -- verify assertions at run time. */ void _assert(char *, const char *, unsigned int); #define assert(x) ((x) == 0 ? _assert(#x, __FILE__, __LINE__):(void)0) - - #endif ---------------------------------------------------------------------- >Comment By: Maarten Brock (maartenbrock) Date: 2007-03-24 20:25 Message: Logged In: YES user_id=888171 Originator: NO Thanks, Applied in SDCC 2.6.5 #4711. ---------------------------------------------------------------------- Comment By: Alexey Shamrin (alsh) Date: 2007-03-23 08:00 Message: Logged In: YES user_id=902831 Originator: NO sf.net tracker broke formating above, attached patch here: http://sourceforge.net/tracker/index.php?func=detail&aid=1686533&group_id=599&atid=300599 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1686528&group_id=599 |