Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 1 Jun 2018 08:01:11 +0200
From: Markus Wichmann <>
Subject: Re: [PATCH] printf: handle the L modifier for integers

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

> 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.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.