From patchwork Thu Mar 17 19:29:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 52070 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 69189384387A for ; Thu, 17 Mar 2022 19:36:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69189384387A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1647545792; bh=oXJNbkdA+pzK/DJ3/5xoQctR23h1Cv7kWcC0DNnnENQ=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=LG8YjnTJYtG2By94dchuZ/+MvvOlnPp6AMN0APMAoAs6JW8JOuCUrD+Pl9lkyoU9g OH1LBBRndZYfStHVWcr83/CrUxcG3sCA+vFxywCz2qKgag6VOe9cV9UbFfj1wa5tdT /ujdpn7h+IwQieVca1tCZgO6NF1/SCreahVEThCQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 59DFD3858413 for ; Thu, 17 Mar 2022 19:29:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 59DFD3858413 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-661-7VHYfP11Mmimz5BATL29fQ-1; Thu, 17 Mar 2022 15:29:55 -0400 X-MC-Unique: 7VHYfP11Mmimz5BATL29fQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 785C18002BF for ; Thu, 17 Mar 2022 19:29:55 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.88]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AF06E40FF708 for ; Thu, 17 Mar 2022 19:29:54 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 09/26] stdio-common: Add printf specifier registry to In-Reply-To: References: X-From-Line: ee994f649cc7ae110a0d4b97ec80e3cc1d880c3f Mon Sep 17 00:00:00 2001 Message-Id: Date: Thu, 17 Mar 2022 20:29:46 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Add __printf_function_table, __register_printf_specifier to include/printf.h, where they belong. --- include/printf.h | 6 ++++++ stdio-common/reg-printf.c | 7 ------- stdio-common/vfprintf-internal.c | 1 - 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/printf.h b/include/printf.h index 0ed6e87387..e1ac20807b 100644 --- a/include/printf.h +++ b/include/printf.h @@ -12,6 +12,12 @@ # ifndef _ISOMAC +/* Internal interfaces for registered specifiers. */ +extern printf_function **__printf_function_table attribute_hidden; +int __register_printf_specifier (int, printf_function, + printf_arginfo_size_function); +libc_hidden_proto (__register_printf_specifier) + #include /* Now define the internal interfaces. */ diff --git a/stdio-common/reg-printf.c b/stdio-common/reg-printf.c index 400b99d2f6..5f4c6a24c2 100644 --- a/stdio-common/reg-printf.c +++ b/stdio-common/reg-printf.c @@ -30,13 +30,6 @@ printf_function **__printf_function_table attribute_hidden; __libc_lock_define_initialized (static, lock) -int __register_printf_specifier (int, printf_function, - printf_arginfo_size_function); -libc_hidden_proto (__register_printf_specifier) -int __register_printf_function (int, printf_function, - printf_arginfo_function); - - /* Register FUNC to be called to format SPEC specifiers. */ int __register_printf_specifier (int spec, printf_function converter, diff --git a/stdio-common/vfprintf-internal.c b/stdio-common/vfprintf-internal.c index 1986c4bdb5..f8aa2fdafb 100644 --- a/stdio-common/vfprintf-internal.c +++ b/stdio-common/vfprintf-internal.c @@ -1379,7 +1379,6 @@ printf_positional (FILE *s, const CHAR_T *format, int readonly_format, /* Process format specifiers. */ while (1) { - extern printf_function **__printf_function_table; int function_done; if (spec <= UCHAR_MAX