public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Josef Wolf <jw@raven.inka.de>
To: newlib@sourceware.org
Subject: Re: undefined references since newlib-3.2.0
Date: Sun, 14 Jun 2020 16:50:06 +0200	[thread overview]
Message-ID: <20200614145006.GG15174@raven.inka.de> (raw)
In-Reply-To: <87pna2hog9.fsf@keithp.com>

On Sat, Jun 13, 2020 at 10:20:54AM -0700, Keith Packard wrote:

> Here are some affected libc functions which don't return a pointer and
> which have no error indication of any kind:
> 
>         atof
>         atoff
> [ ... ]
>         strtod
>         strtof
>         strtold
>         wcstod
>         wcstold
>         strtodg

Uh! Why on earth would those functions need to allocate memory?

> These now return infinity and set errno to ERANGE on allocation
> failure. (not ideal, but the options are limited)
> 
> Here are some which do return a pointer, but do not document any errors:
> 
>         ecvt
>         fcvt

Maybe the documentation can be fixed?

>         gcvt
>         ecvtbuf
>         fcvtbuf
>         gcvtbuf

Those get a pointer passed. No need to allocate memory.

> And here's a list of functions which I feel reasonable applications
> should not expect an allocation error from:

I don't think any application should expect those functions to call exit()
and/or abort() either.

>         sprintf
>         snprintf

Those should return -1 on failure.

>         sscanf

For this, ENOMEM is documented.

-- 
Josef Wolf
jw@raven.inka.de

  reply	other threads:[~2020-06-14 14:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09  8:00 Wolf, Josef
2020-06-12  8:21 ` Josef Wolf
2020-06-12 22:50   ` Josef Wolf
2020-06-13  0:05     ` Keith Packard
2020-06-13  8:27       ` Josef Wolf
2020-06-13 17:20         ` Keith Packard
2020-06-14 14:50           ` Josef Wolf [this message]
2020-06-14 17:02             ` Keith Packard
2020-06-14 17:40               ` Brian Inglis
2020-06-14 20:13                 ` Keith Packard
2020-06-15  4:53               ` Dimitrios Glynos
2020-06-16  3:43                 ` Keith Packard
2020-06-17 11:36           ` Josef Wolf
2020-06-13 10:31     ` Jeffrey Walton

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=20200614145006.GG15174@raven.inka.de \
    --to=jw@raven.inka.de \
    --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).