* [PATCH 1/1] change forced use of __assert_func to use the assert macro in reent.h and mprec.h, this honors the use of -DNDEBUG to not use assertion
2020-01-22 16:26 [PATCH 0/1] replace forced __assert_func with assert macro KrimtonZ
@ 2020-01-22 16:26 ` KrimtonZ
0 siblings, 0 replies; 2+ messages in thread
From: KrimtonZ @ 2020-01-22 16:26 UTC (permalink / raw)
To: newlib; +Cc: KrimtonZ
---
newlib/libc/include/sys/reent.h | 2 +-
newlib/libc/stdlib/mprec.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h
index 74b70e9c0..2d561453f 100644
--- a/newlib/libc/include/sys/reent.h
+++ b/newlib/libc/include/sys/reent.h
@@ -501,7 +501,7 @@ extern const struct __sFILE_fake __sf_fake_stderr;
/* Specify how to handle reent_check malloc failures. */
#ifdef _REENT_CHECK_VERIFY
#include <assert.h>
-#define __reent_assert(x) ((x) ? (void)0 : __assert_func(__FILE__, __LINE__, (char *)0, "REENT malloc succeeded"))
+#define __reent_assert(x) ((x) ? (void)0 : assert("REENT malloc succeeded"))
#else
#define __reent_assert(x) ((void)0)
#endif
diff --git a/newlib/libc/stdlib/mprec.h b/newlib/libc/stdlib/mprec.h
index a1492aa38..595f485d4 100644
--- a/newlib/libc/stdlib/mprec.h
+++ b/newlib/libc/stdlib/mprec.h
@@ -344,7 +344,7 @@ typedef struct _Bigint _Bigint;
#define eBalloc(__reent_ptr, __len) ({ \
void *__ptr = Balloc(__reent_ptr, __len); \
if (__ptr == NULL) \
- __assert_func(__FILE__, __LINE__, (char *)0, "Balloc succeeded"); \
+ assert("Balloc succeeded"); \
__ptr; \
})
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 0/1] replace forced __assert_func with assert macro
@ 2020-01-22 16:26 KrimtonZ
2020-01-22 16:26 ` [PATCH 1/1] change forced use of __assert_func to use the assert macro in reent.h and mprec.h, this honors the use of -DNDEBUG to not use assertion KrimtonZ
0 siblings, 1 reply; 2+ messages in thread
From: KrimtonZ @ 2020-01-22 16:26 UTC (permalink / raw)
To: newlib; +Cc: KrimtonZ
Modified the implementation of eBalloc to use the assert macro over the
hardcoded __assert_func. The same is done for __reent_assert. This
will honor the usage of -DNDEBUG to prevent the usage of assertion.
KrimtonZ (1):
change forced use of __assert_func to use the assert macro in reent.h
and mprec.h, this honors the use of -DNDEBUG to not use assertion
newlib/libc/include/sys/reent.h | 2 +-
newlib/libc/stdlib/mprec.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-22 16:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-22 16:26 [PATCH 0/1] replace forced __assert_func with assert macro KrimtonZ
2020-01-22 16:26 ` [PATCH 1/1] change forced use of __assert_func to use the assert macro in reent.h and mprec.h, this honors the use of -DNDEBUG to not use assertion KrimtonZ
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).