From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12879 Path: news.gmane.org!.POSTED!not-for-mail From: Markus Wichmann Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] printf: handle the L modifier for integers Date: Fri, 1 Jun 2018 08:01:11 +0200 Message-ID: <20180601060111.GA3121@voyager> References: <20180531215655.6662-1-avagin@virtuozzo.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1527832761 25586 195.159.176.226 (1 Jun 2018 05:59:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 1 Jun 2018 05:59:21 +0000 (UTC) User-Agent: Mutt/1.9.4 (2018-02-28) To: musl@lists.openwall.com Original-X-From: musl-return-12895-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jun 01 07:59:17 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fOd5o-0006YX-S5 for gllmg-musl@m.gmane.org; Fri, 01 Jun 2018 07:59:16 +0200 Original-Received: (qmail 24087 invoked by uid 550); 1 Jun 2018 06:01:25 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 24068 invoked from network); 1 Jun 2018 06:01:24 -0000 Content-Disposition: inline In-Reply-To: <20180531215655.6662-1-avagin@virtuozzo.com> X-Provags-ID: V03:K1:Y6fnHZRh5Owl+UxHtLLAflDawdeRSVHOJvP0WCNecAcHJZW7Eav QTRAm7aoMLwZ5B2eEQ6iFM30OaVpuU3M53vvhRUMDsQxUVXX2PoIt/r6CmhWqZp8TQWajna oKJXHOS5+lXXctnItaTjdQASKPLdYm0n+6tSuHyC1k/PFFMdqUmoqPVCCNgNNSWh1nNGED6 NdPd4xSJf5yc97U7SwKRQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:Bps4VcVlhqs=:T6OhAHKYhTYDuRpVCAarqH yv7Ybktsy8KvniWebS/dJkHTulINmMDHPeRHVgH2VUh+W3IZt4eK9fOb7RTtSr+1v5tcx+Nhj xGQz/Qqml6Np94drG8ZsdDfsQOjXR7cKfBNl1AHjjSh33JuQLtWcImtlQJWRyZeJxGFYIPTPb 5P5ZTQgY9IM55bCNm7OtnvEKOxFA/uhU5CTx4E+T/1sSuv1CYey9lHJAYiflDjY1bgwlzgNze y02ty25XAXVA8lpNewkor5cq2kfaV+gdjtyRb9989VfIBAeSbMJ4BTRhO3VQpBA0mXGaFsyWJ OwWW1e/yf41/mRZbCpbcilPZXEORR/QljRqrnPAGifk7GxewHTyzybaqP9OV2Dn6btMQaJmTa H1qeOSaQL5RllPTlwFKQ7MSyBOKN+iNtLvrTCglf16eb0iLNZjgq1nIp9bkffD0sGv1RLPxQ2 Zoa4le/i/88GkoAzUz9S7tO24L+BN8utf97PQiod9ya8rRKdll9jZrTLflPipnN4FR5R9NrBh vJ2FxbxInh+SjR90n/SmFlcKMecplSP1wevtHT7qjQmmPMihTkBdZ9aYkbXfubztvh54cZSJl UQlnBEdyKmdzvJviwiVLl23nXLb+nann9q5aI+YGshvsgfQcQOHFID99IvGDisdcZ1BiHUO73 Wjl7s+h2UQiSt5ILzHTRiM8XQen0qbOHYyffjniiVfhRV4pTicaUVEL5ymBL5SbwI/s7Sxia3 0IZ8wXHNqe+MwL3u1v4pvYiIyz4fA6mRIKcajbur7o+yyFTIWt0g9mVuQLw= Xref: news.gmane.org gmane.linux.lib.musl.general:12879 Archived-At: 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