From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12863 Path: news.gmane.org!.POSTED!not-for-mail From: "Laurent Bercot" Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] scanf: handle the L modifier for integers Date: Thu, 31 May 2018 14:20:19 +0000 Message-ID: References: <20180531064719.6805-1-avagin@virtuozzo.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1527776307 7901 195.159.176.226 (31 May 2018 14:18:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 31 May 2018 14:18:27 +0000 (UTC) User-Agent: eM_Client/7.1.31849.0 To: musl@lists.openwall.com Original-X-From: musl-return-12879-gllmg-musl=m.gmane.org@lists.openwall.com Thu May 31 16:18:23 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 1fOOPH-0001yF-Js for gllmg-musl@m.gmane.org; Thu, 31 May 2018 16:18:23 +0200 Original-Received: (qmail 29776 invoked by uid 550); 31 May 2018 14:20:32 -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 29758 invoked from network); 31 May 2018 14:20:31 -0000 In-Reply-To: <20180531064719.6805-1-avagin@virtuozzo.com> X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedthedriedvgdejjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfpfgfogfftkfevteeunffgpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfgjfhhrfgggtgfgsehtqhertddtreejnecuhfhrohhmpedfnfgruhhrvghnthcuuegvrhgtohhtfdcuoehskhgrqdguihgvthhlihgstgesshhkrghrnhgvthdrohhrgheqnecuffhomhgrihhnpehophgvnhhgrhhouhhprdhorhhgnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtnecuvehluhhsthgvrhfuihiivgeptd Xref: news.gmane.org gmane.linux.lib.musl.general:12863 Archived-At: >Without this patch, ret will be 1 and mask will be 0. It is obviously >incorrect. According to the man page, L should work like ll: > >L Indicates that the conversion will be either e, f, or g and the > next pointer is a pointer to long double or the conversion will > be d, i, o, u, or x and the next pointer is a pointer to long > long. This is a GNU extension. POSIX states that L is only valid before a floating-point conversion specifier: L Specifies that a following a, A, e, E, f, F, g, or G conversion=20 specifier applies to an argument with type pointer to long double. from=20 http://pubs.opengroup.org/onlinepubs/9699919799/functions/scanf.html So, it is valid for musl not to accept %Lx. Now, the argument that it's a good idea to align musl's behaviour to glibc's whenever possible is a sensible one. But it's a decision for the musl authors to make, and the pros and cons need to be carefully balanced; musl's current behaviour is not _incorrect_. -- Laurent