From patchwork Wed Jun 13 18:19:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Sebor X-Patchwork-Id: 929016 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-93196-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="rA+h6aQS"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 415ZlY4sR7z9ryk for ; Thu, 14 Jun 2018 04:19:20 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type; q=dns; s=default; b=htmGLZydXjdMKlatDmGPG6nhGtcog P83f/Em9HwJxM+7wRK5Eb4To48cMwi33Dh1GDZ8lBL7oY9kZdsbtEga53MynbafG k9cqiJgeCr0TW8qSEw1eDvUb/dEHHfulLMmHKq2RTE1uquR03pZcw0bM/IAPEuMe syZ9V7QUVKZxQQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type; s=default; bh=k+qgyFM00K6z1zd0T6UPjtDv0rs=; b=rA+ h6aQSMArLC+UmrMHB3k6SgILxzBAlEGAL2M1BJfpQoS3opeaI6nwZ5klUWbQFvGY EXKTMwTQQbQ08Hwtm27k+VDIxX1UdudcwEbwMbsN7vuzDY+t0L+8PZcVS873OZ9C aCIlmfrIP7lXGoUYm4t2twbQfpRbO5HRAvh9Biok= Received: (qmail 112846 invoked by alias); 13 Jun 2018 18:19:15 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 112778 invoked by uid 89); 13 Jun 2018 18:19:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=customizing, Customizing, interfere X-HELO: mail-oi0-f68.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version; bh=r2ZSLtJYWb+3OD/CA+BOuILtmFV7GbXUSULBdbxuGaI=; b=edLkoAG/nky/m8MIWig80oP2kHaLAg8B3S/s4airCZOaCZglri19lzC0GvFax93hhI J07qyaPdxqZ8Vvg0K2Jqz5Jz+Sqr+1Cecjb8RcGSFo6neJN04BqDVodaldwJn3JVTaF7 YFyOmEXRK8QB/jbbanAeUB+ASx0PZTC8qwuGi5yBNmKh4hb3ZqOjzAItP3tIKJmgVvGa 2kHRLcnPMKfoXkq9Mv9m+WyKHhz4j8DM6QBCEVcJdxdgu4Br91/LUzF7wGPC6sgU1R70 9NW8obUTJTjsT4iZ/F78mdTTgKHHRVClMc/JPpRHDEZHjwRdoIeVz0g2PGSNrE2xHgdC u3EQ== X-Gm-Message-State: APt69E2HRxsOwiF/Fyn1SbED3fkLtGzFD85HWZGafwkutFgsMxBuiLge kTBrnPCUQAw+e0xZ0D1CX4WbCg== X-Google-Smtp-Source: ADUXVKJQhGuDaIEB43YjBJN2sacOqVC0sP87lIk+jdZJET6krZ3TYDDJIo4cBuJkoQGeHBecKa9QEg== X-Received: by 2002:aca:f5d5:: with SMTP id t204-v6mr5248210oih.27.1528913944512; Wed, 13 Jun 2018 11:19:04 -0700 (PDT) To: GNU C Library From: Martin Sebor Subject: [PATCH] mention disabling GCC built-ins for customization Message-ID: <2f2f96d3-5487-f791-8554-310beae0721b@gmail.com> Date: Wed, 13 Jun 2018 12:19:00 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 The GCC sprintf optimization introduced in GCC 7 relies on the conformance of the library implementation of formatted I/O functions. When a sprintf customization changes the effects of the function in a way that's observable by a strictly conforming program it might interfere with the optimization. Since this may not be obvious to users the attached patch adds a couple of sentences to the manual to make it clear that the sprintf built-in handling needs to be disabled when customizing the function. Martin ChangeLog: * manual/stdio.texi (Customizing printf): Add a note to disable built-in handling. diff --git a/manual/stdio.texi b/manual/stdio.texi index 38be236..d945955 100644 --- a/manual/stdio.texi +++ b/manual/stdio.texi @@ -2963,7 +2963,11 @@ The facilities of this section are declared in the header file @strong{Portability Note:} The ability to extend the syntax of @code{printf} template strings is a GNU extension. ISO standard C has -nothing similar. +nothing similar. When using the GNU C compiler or any other compiler +that interprets calls to standard I/O functions according to the rules +of the language standard it is necessary to disable such handling by +the appropriate compiler option. Otherwise the behavior of a program +that relies on the extension is undefined. @node Registering New Conversions @subsection Registering New Conversions