Re: undefined references since newlib-3.2.0
Josef Wolf <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <[email protected]> |
Thanks for your reply, Keith! On Fri, Jun 12, 2020 at 05:05:15PM -0700, Keith Packard wrote: > Josef Wolf <[email protected]> writes: > > > This patch replaces Balloc() by eBalloc() which calls __assert_func() on > > failure which in turn calls exit() and/or abort() > > As an interim step, having a fix available sooner was a good thing. I see. But at a first glance, returning NULL seems to be not much more work. > > Shouldn't those library functions simply report the error by returning NULL to > > the caller and let the application handle the situation? > > It's complicated by the libc API which doesn't have defined error return > values for all of the affected APIs. I don't really understand this. The classical way to return error from functions returning a pointer is to return NULL. One has to make sure not to leak, of course. Which return values would be needed beyond NULL? -- Josef Wolf [email protected]