From: KrimtonZ <krimtonz@gmail.com>
To: newlib@sourceware.org
Cc: KrimtonZ <krimtonz@gmail.com>
Subject: [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
Date: Wed, 22 Jan 2020 16:26:00 -0000 [thread overview]
Message-ID: <20200122162628.19385-2-krimtonz@gmail.com> (raw)
In-Reply-To: <20200122162628.19385-1-krimtonz@gmail.com>
---
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
prev parent reply other threads:[~2020-01-22 16:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-22 16:26 [PATCH 0/1] replace forced __assert_func with assert macro KrimtonZ
2020-01-22 16:26 ` KrimtonZ [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200122162628.19385-2-krimtonz@gmail.com \
--to=krimtonz@gmail.com \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).