mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Subject: Re: [PATCH] printf: handle the L modifier for integers
Date: Fri, 1 Jun 2018 08:01:11 +0200	[thread overview]
Message-ID: <20180601060111.GA3121@voyager> (raw)
In-Reply-To: <20180531215655.6662-1-avagin@virtuozzo.com>

On Fri, Jun 01, 2018 at 12:56:55AM +0300, Andrei Vagin wrote:
> The L modifier is usually used for floating-point numbers, but
> glibc allows to use this modifier for integers too.
> 

Nice for them. Looking forward to seeing how they deal with any possible
future standard definition of %Ld. Probably the same ugly way they deal
with signal() and scanf(), i.e. provide different #defines for them
based on feature flags.

> I think here is nothing wrong if we will be compatible with glibc here.
> 

Yes there is, and it was just explained: It breaks forward
compatibility.

> It is not often when a error code of printf is checked, so we may have
> a situation when a code works with glibc and doesn't work with musl.
> 

Correct solution is then to detect this abuse of the interface and to
crash. That is something the programmer can't ignore.

Code "working" with one implementation and not with another is a little
thing known as undefined behavior. Good programmers avoid it.

Ciao,
Markus


      reply	other threads:[~2018-06-01  6:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 21:56 Andrei Vagin
2018-06-01  6:01 ` Markus Wichmann [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=20180601060111.GA3121@voyager \
    --to=nullplan@gmx.net \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).