public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Zack Weinberg <zackw@panix.com>
To: Alejandro Colomar <alx.manpages@gmail.com>
Cc: libc-alpha@sourceware.org, linux-man@vger.kernel.org,
	 mtk.manpages@gmail.com
Subject: Re: [PATCH] makecontext.3: Fix function declarator with empty parentheses.
Date: Thu, 4 Mar 2021 15:10:30 -0500	[thread overview]
Message-ID: <CAKCAbMg3G4EAeuUhN9EQTDnrTSD0sPoH0uH1=kkpfj9qYorPdg@mail.gmail.com> (raw)
In-Reply-To: <20210304194534.130735-1-alx.manpages@gmail.com>

On Thu, Mar 4, 2021 at 2:48 PM Alejandro Colomar via Libc-alpha <
libc-alpha@sourceware.org> wrote:

> glibc uses 'void (*f)(void)' for makecontext()'s second parameter.


Did you mean ‘void (*f)()’ ?

C11 marked function declarators with empty parentheses as
> obsolescent:
>
>
> >   6.11.6  Function declarators
> > 1 The use of function declarators with empty parentheses (not
> >   prototype-format parametertype declarators) is an obsolescent
> >   feature.
>
>
> Let's use the correct syntax by explicitly using '(void)


Unfortunately this change would be incorrect. makecontext’s second
parameter really is a pointer to a function that takes any number and type
of arguments, and there is no other way to write that in C than ‘void
(*)()’. Which, yes, means this function cannot be declared in conformant
C11.

This is actually the Austin Group’s primary rationale for deprecating
makecontext and its relatives.

zw

>

  reply	other threads:[~2021-03-04 20:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04 19:45 Alejandro Colomar
2021-03-04 20:10 ` Zack Weinberg [this message]
2021-03-04 21:10   ` Florian Weimer
2021-03-05  1:13     ` Alejandro Colomar (man-pages)
2021-03-05 10:21       ` Florian Weimer
2021-03-05 10:27         ` Andreas Schwab
2021-03-05 12:48         ` Alejandro Colomar (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKCAbMg3G4EAeuUhN9EQTDnrTSD0sPoH0uH1=kkpfj9qYorPdg@mail.gmail.com' \
    --to=zackw@panix.com \
    --cc=alx.manpages@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).