From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_REPLYTO_END_DIGIT, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id E41BA1F9E0 for ; Sun, 26 Apr 2020 19:18:53 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C66E63971C3E; Sun, 26 Apr 2020 19:18:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C66E63971C3E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1587928732; bh=U8kJZo5X6sIPyRFe9SY7Mlbk/mvZyakpZAkspxOv5q0=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=XZqFL0/rmNMQY/ezqu/GdP5aQemVX2sGq9BRFKb2oPUH+2BPav+C8AShRHOgcPY2T ylHY39fcFtcQCi3yu7sDwQ+9WpQVLPp4ORkWmXiIPR6mxmleIwDRv3LoFaMdVyeRj9 EBeTYhcp+8S4EXcTI+3Uh6afTfmRRGvGx/L3R6v4= Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by sourceware.org (Postfix) with ESMTPS id 870E73971C3E for ; Sun, 26 Apr 2020 19:18:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 870E73971C3E Received: by mail-wr1-x442.google.com with SMTP id k13so18009428wrw.7 for ; Sun, 26 Apr 2020 12:18:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=U8kJZo5X6sIPyRFe9SY7Mlbk/mvZyakpZAkspxOv5q0=; b=d0fpMmzDX3sdG7lEbWLXXcBbKTvhn8A9LMunTWopBMJGu1Vu1IuQqt7dKRv4t8DRae EjcKuUrQ2qp7i/lMP/Di1UMqanWjgTIhOsPMlgtEBB6QIGmmbjgF6x9AryX+eHq3eZak ZrE0D5IdZSnOdmOIbhiKf+ly8e/2/lVt4rsCrm/1+/WpTlUagm549u6Cw00x2U1kIdNg azloAs2fKLvCgO+wl/LvljS/XdXpSt9hC2qkBRTN7NwxdpoIrIS0CT0xVeyLgFMK7HOK dDv8y1Zu8SGveBPUZGrCX7hUtYGVeapIPvXu7PvkGCoqIkVt3o/EA8/0JglAm68Mvtjd akQA== X-Gm-Message-State: AGi0PubdXWdIn0mvNhYvR75s+pxwvG2H87sPg+Wpe1+jeISqlM56dG2p o5aA5wKzp5QFHICc0L4/QFRXmRaf X-Google-Smtp-Source: APiQypJyu88lFXkWNF4rY3DKDWFSd5P5/MGKOk1spVSNPtujLW7q/laXRCQOXqUYuVzweCSeYY3+1Q== X-Received: by 2002:a5d:6ad1:: with SMTP id u17mr22819238wrw.170.1587928728640; Sun, 26 Apr 2020 12:18:48 -0700 (PDT) Received: from [192.168.1.131] ([93.176.137.11]) by smtp.gmail.com with ESMTPSA id n9sm17793589wrx.61.2020.04.26.12.18.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Apr 2020 12:18:48 -0700 (PDT) Subject: Re: printf %b To: libc-alpha@sourceware.org References: <1137ece3-27fb-0ca8-22df-dcc69077f354@gmail.com> <20200426005407.GE877@gmail.com> <6e163d3e-fc4f-7a87-6168-890c21a00dde@gmail.com> Message-ID: <553f5205-88ea-f417-09d4-3245f384a274@gmail.com> Date: Sun, 26 Apr 2020 21:18:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <6e163d3e-fc4f-7a87-6168-890c21a00dde@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Alejandro Colomar via Libc-alpha Reply-To: Alejandro Colomar Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" On 4/26/20 4:29 AM, Alejandro Colomar wrote: > Hmmm. Good point. Maybe, given that binary doesn't have letters such > as hex does, we don't need both ``%b`` and ``%B``. We could have just > ``%B`` (if it isn't already taken by some other thing) and use it for > binary. I have written the patch to add ``%B`` (not ``%b``) for binary. I added a few tests to ``stdio-common/tst-printf.c``, which work fine. I also compiled the extensive test that I had for my library, with the new glibc, and it worked also fine. Issues: - Not yet implemented: Separator for nibbles. (If I implement this, I would like to also implement it for hex bytes). - GCC 9 doesn't know of this specifier, so in the tests I had to disable that diagnostic. When GCC accepts it, those pragmas should be removed. - ``stdio-common/tst-printfsz.c`` registers ``%B`` for something else (it uses ``register_printf_function()``, so it overwrites the specifier, and shouldn't cause any problems at all). TODO (I will do them ASAP (when I know howto, actually)): - Documentation (both glibc and man 3 printf). - patch GCC to accept the new specifier. I had some problems following the `contribution checklist`_: _`contribution checklist`: https://sourceware.org/glibc/wiki/Contribution%20checklist - ``find . -name ChangeLog`` shows nothing to me: :: $ find . -name ChangeLog $ find . |grep ChangeLog ./ChangeLog.old ./ChangeLog.old/ChangeLog.ports-m68k ./ChangeLog.old/ChangeLog.9 ./ChangeLog.old/ChangeLog.4 ./ChangeLog.old/ChangeLog.13 ./ChangeLog.old/ChangeLog.ports-tile ./ChangeLog.old/ChangeLog.5 ./ChangeLog.old/ChangeLog.ports-arm ./ChangeLog.old/ChangeLog.16 ./ChangeLog.old/ChangeLog.localedata ./ChangeLog.old/ChangeLog.8 ./ChangeLog.old/ChangeLog.ports-microblaze ./ChangeLog.old/ChangeLog.ports-aarch64 ./ChangeLog.old/ChangeLog.ports-am33 ./ChangeLog.old/ChangeLog.ports-mips ./ChangeLog.old/ChangeLog.ports-aix ./ChangeLog.old/ChangeLog.nptl_db ./ChangeLog.old/ChangeLog.ports-hppa ./ChangeLog.old/ChangeLog.6 ./ChangeLog.old/ChangeLog.14 ./ChangeLog.old/ChangeLog.1 ./ChangeLog.old/ChangeLog.ports-powerpc ./ChangeLog.old/ChangeLog.nptl ./ChangeLog.old/ChangeLog.7 ./ChangeLog.old/ChangeLog.19 ./ChangeLog.old/ChangeLog.15 ./ChangeLog.old/ChangeLog.2 ./ChangeLog.old/ChangeLog.ports ./ChangeLog.old/ChangeLog.18 ./ChangeLog.old/ChangeLog.libidn ./ChangeLog.old/ChangeLog.12 ./ChangeLog.old/ChangeLog.11 ./ChangeLog.old/ChangeLog.ports-ia64 ./ChangeLog.old/ChangeLog.20 ./ChangeLog.old/ChangeLog.ports-cris ./ChangeLog.old/ChangeLog.ports-linux-generic ./ChangeLog.old/ChangeLog.ports-alpha ./ChangeLog.old/ChangeLog.10 ./ChangeLog.old/ChangeLog.17 ./ChangeLog.old/ChangeLog.3 - I couldn't create an account on http://patchwork.sourceware.org/ because that link is broken (500 Internal server error). Regards, Alex.