From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 94C90385800F for ; Fri, 5 Mar 2021 10:21:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 94C90385800F Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-442-tSgCFiVwPUSpQnBmXUlBig-1; Fri, 05 Mar 2021 05:21:29 -0500 X-MC-Unique: tSgCFiVwPUSpQnBmXUlBig-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7603C108BD06; Fri, 5 Mar 2021 10:21:28 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-208.ams2.redhat.com [10.36.113.208]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 067E262AF6; Fri, 5 Mar 2021 10:21:26 +0000 (UTC) From: Florian Weimer To: "Alejandro Colomar (man-pages)" Cc: Zack Weinberg , mtk.manpages@gmail.com, linux-man@vger.kernel.org, libc-alpha@sourceware.org Subject: Re: [PATCH] makecontext.3: Fix function declarator with empty parentheses. References: <20210304194534.130735-1-alx.manpages@gmail.com> <87v9a6hbgt.fsf@oldenburg.str.redhat.com> Date: Fri, 05 Mar 2021 11:21:36 +0100 In-Reply-To: (Alejandro Colomar's message of "Fri, 5 Mar 2021 02:13:52 +0100") Message-ID: <8735x9hpe7.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Fri, 05 Mar 2021 10:21:33 -0000 * Alejandro Colomar: > I did actually mean 'void (*f)(void)'. Glibc uses that for the > prototype (as you can see from my commit message (see above)), and as I > confirmed just now, it also uses that type for the definition of the > function: > > [ > .../glibc$ grep -rn '^makecontext\s*(' > stdlib/makecontext.c:22:makecontext (ucontext_t *ucp, void (*func) > (void), int argc, ...) > .../glibc$ > ] > > However, I should have read the manual page (I must admit that I only > read the SYNOPSIS and EXAMPLES sections of the manual page and the glibc > source before writing the patch). It's clear that the prototype that > was being used in the manual page was more correct (in the sense that it > more accurately represented the actual expected function pointer) than > the glibc prototype (eventhough the glibc prototype is more standards > conforming). > > So my patch is wrong. > > Florian, should I file a bug in glibc's bugzilla? I don't know. SUSv2 has (void *func) (), which would make this a glibc bug. I'm not sure if I have easy access to POSIX.1 from 2001, which I believe still has this function. I am not sure if all glibc implementations of makecontext can be used to call variadic functions. Thanks, Florian