From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8005 invoked by alias); 26 Mar 2018 15:47:04 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 7991 invoked by uid 89); 26 Mar 2018 15:47:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=surgery, corrected, day X-HELO: mailbackend.panix.com X-Gm-Message-State: AElRT7GOEFpNhEq5wMX/5uXHYNbOz1JbWjvPoPrZrE9Q5Lu6Syajm3VA 4ggxQBKZTCBWZAMqElGQ3EKdM3GFdB4D+8InBvU= X-Google-Smtp-Source: AG47ELsHpjnBiwe5CRLEs+SKZKNgyaJXdXCNoMjMsNM7rOoZUN8RnOY92coRhFErUIQOdXM+RpxfGFVY5DgrvYgYAfc= X-Received: by 2002:a9d:480d:: with SMTP id c13-v6mr10197126otf.385.1522079219723; Mon, 26 Mar 2018 08:46:59 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20180326121624.67e57494@tereshkova> References: <20180307193205.4751-1-zackw@panix.com> <20180326121624.67e57494@tereshkova> From: Zack Weinberg Date: Mon, 26 Mar 2018 15:47:00 -0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/9] Use more flags parameters instead of global bits in stdio To: "Gabriel F. T. Gomes" Cc: GNU C Library Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-03/txt/msg00554.txt.bz2 On Mon, Mar 26, 2018 at 11:16 AM, Gabriel F. T. Gomes wrote: > On Wed, 07 Mar 2018, Zack Weinberg wrote: > >>I got stuck on the patch to use C99-compliant scanf in _GNU_SOURCE >>mode because the interaction with ldbl-is-dbl was too confusing. The >>reason it's too confusing is that C99 compliance in scanf, ldbl-is-dbl >>mode in scanf, printf, and strfmon, and fortify mode in printf are >>handled with mode bits on the FILE and thread-global flags that must >>be set and reset at just the right times. Correct behavior is >>invariably to set and then reset around just one call to a lower-level >>function, and there's a better way to do that: flags parameters. >> >>This patch series implements _internal variants of scanf, printf, >>strfmon, and syslog that take flag parameters that control C99 >>compliance, ldbl-is-dbl mode, and fortification. > > Thanks for doing this. It looks a lot less confusing now. Thanks for reviewing. I will look at all your individual comments when I cycle back to this patchset again, which might not be for a while -- as I mentioned in another message, trying to get the hidden annotations 100% correct has sent me down a rabbit hole (first "let's write a test so that these problems are automatically detected in the future", and then "... whoops, there are a lot of existing errors that will need to be corrected before we can have that test", and now I'm on "fixing some of those errors involves major surgery on libpthread and ld.so" :-/ ) and meanwhile I do have a day job that has nothing to do with any of this. zw