All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] makecontext.3: Fix function declarator with empty parentheses.
@ 2021-03-04 19:45 Alejandro Colomar
       [not found] ` <CAKCAbMg3G4EAeuUhN9EQTDnrTSD0sPoH0uH1=kkpfj9qYorPdg@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Alejandro Colomar @ 2021-03-04 19:45 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, libc-alpha

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-05 12:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04 19:45 [PATCH] makecontext.3: Fix function declarator with empty parentheses Alejandro Colomar
     [not found] ` <CAKCAbMg3G4EAeuUhN9EQTDnrTSD0sPoH0uH1=kkpfj9qYorPdg@mail.gmail.com>
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)

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.