All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx.manpages@gmail.com>
To: mtk.manpages@gmail.com
Cc: Alejandro Colomar <alx.manpages@gmail.com>,
	linux-man@vger.kernel.org, libc-alpha@sourceware.org
Subject: [PATCH] makecontext.3: Fix function declarator with empty parentheses.
Date: Thu,  4 Mar 2021 20:45:35 +0100	[thread overview]
Message-ID: <20210304194534.130735-1-alx.manpages@gmail.com> (raw)

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

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)'.

.../glibc$ grep_glibc_prototype makecontext
stdlib/ucontext.h:51:
extern void makecontext (ucontext_t *__ucp, void (*__func) (void),
			 int __argc, ...) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/makecontext.3 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/man3/makecontext.3 b/man3/makecontext.3
index 83720dd2c..ac9afcf69 100644
--- a/man3/makecontext.3
+++ b/man3/makecontext.3
@@ -32,7 +32,8 @@ makecontext, swapcontext \- manipulate user context
 .nf
 .B #include <ucontext.h>
 .PP
-.BI "void makecontext(ucontext_t *" ucp ", void (*" func ")(), int " argc ", ...);"
+.BI "void makecontext(ucontext_t *" ucp ", void (*" func ")(void), int " argc \
+", ...);"
 .BI "int swapcontext(ucontext_t *" oucp ", const ucontext_t *" ucp );
 .fi
 .SH DESCRIPTION
-- 
2.30.1.721.g45526154a5


             reply	other threads:[~2021-03-04 19:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04 19:45 Alejandro Colomar [this message]
     [not found] ` <CAKCAbMg3G4EAeuUhN9EQTDnrTSD0sPoH0uH1=kkpfj9qYorPdg@mail.gmail.com>
2021-03-04 21:10   ` [PATCH] makecontext.3: Fix function declarator with empty parentheses 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=20210304194534.130735-1-alx.manpages@gmail.com \
    --to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.