* [PATCH] ffs.3: all these functions live in <strings.h>.
@ 2023-11-14 0:51 enh
2023-11-14 10:20 ` Alejandro Colomar
0 siblings, 1 reply; 2+ messages in thread
From: enh @ 2023-11-14 0:51 UTC (permalink / raw)
To: linux-man, Alejandro Colomar (man-pages)
[-- Attachment #1: Type: text/plain, Size: 427 bytes --]
In most cases you'll get them transitively through <string.h>, but it's
misleading for the man page to claim that they're _in_ <string.h>, and
especially weird to claim they're in _different_ headers from each
other!
This is also true of Apple's headers, and FreeBSD (the other BSDs only
have ffs(), not its siblings).
Signed-off-by: Elliott Hughes <enh@google.com>
---
man3/ffs.3 | 6 ------
1 file changed, 6 deletions(-)
[-- Attachment #2: 0001-ffs.3-all-these-functions-live-in-strings.h.patch --]
[-- Type: text/x-patch, Size: 1130 bytes --]
From 2862b4c94c01fda639fc1dd1fb94479eee1712b9 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <enh@google.com>
Date: Mon, 13 Nov 2023 16:46:43 -0800
Subject: [PATCH] ffs.3: all these functions live in <strings.h>.
In most cases you'll get them transitively through <string.h>, but it's
misleading for the man page to claim that they're _in_ <string.h>, and
especially weird to claim they're in _different_ headers from each
other!
This is also true of Apple's headers, and FreeBSD (the other BSDs only
have ffs(), not its siblings).
Signed-off-by: Elliott Hughes <enh@google.com>
---
man3/ffs.3 | 6 ------
1 file changed, 6 deletions(-)
diff --git a/man3/ffs.3 b/man3/ffs.3
index 5a5e1c21c..aab5f1099 100644
--- a/man3/ffs.3
+++ b/man3/ffs.3
@@ -22,9 +22,6 @@ Standard C library
.B #include <strings.h>
.P
.BI "int ffs(int " i );
-.P
-.B #include <string.h>
-.P
.BI "int ffsl(long " i );
.BI "int ffsll(long long " i );
.fi
@@ -87,9 +84,6 @@ T{
.BR ffsll ()
T} Thread safety MT-Safe
.TE
-.SH VERSIONS
-BSD systems have a prototype in
-.IR <string.h> .
.SH STANDARDS
.TP
.BR ffs ()
--
2.42.0.869.gea05f2083d-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ffs.3: all these functions live in <strings.h>.
2023-11-14 0:51 [PATCH] ffs.3: all these functions live in <strings.h> enh
@ 2023-11-14 10:20 ` Alejandro Colomar
0 siblings, 0 replies; 2+ messages in thread
From: Alejandro Colomar @ 2023-11-14 10:20 UTC (permalink / raw)
To: enh; +Cc: linux-man, Alejandro Colomar (man-pages)
[-- Attachment #1: Type: text/plain, Size: 3138 bytes --]
Hi Elliott,
On Mon, Nov 13, 2023 at 04:51:00PM -0800, enh wrote:
> In most cases you'll get them transitively through <string.h>, but it's
> misleading for the man page to claim that they're _in_ <string.h>, and
> especially weird to claim they're in _different_ headers from each
> other!
Indeed.
$ grepc -l ffs /usr/include/
/usr/include/strings.h
$ grepc -l ffsl /usr/include/
/usr/include/strings.h
$ grepc -l ffsll /usr/include/
/usr/include/strings.h
>
> This is also true of Apple's headers, and FreeBSD (the other BSDs only
> have ffs(), not its siblings).
$ pwd
/home/alx/src/bsd/freebsd/main
$ find . -type f | grep '/include/.*\.h$' | xargs grep -l ffs | xargs grepc -l ffs
./include/strings.h
$ find . -type f | grep '/include/.*\.h$' | xargs grep -l ffs | xargs grepc -l ffsl
./include/strings.h
$ find . -type f | grep '/include/.*\.h$' | xargs grep -l ffs | xargs grepc -l ffsll
./include/strings.h
$ pwd
/home/alx/src/bsd/openbsd/master
$ find . -type f | grep '/include/.*\.h$' | xargs grep -l ffs | xargs grepc -l ffs
./gnu/gcc/include/libiberty.h
./gnu/lib/libiberty/include/libiberty.h
./gnu/usr.bin/binutils-2.17/include/libiberty.h
./include/strings.h
$ find . -type f | grep '/include/.*\.h$' | xargs grep -l ffs | xargs grepc -l ffsl
$ find . -type f | grep '/include/.*\.h$' | xargs grep -l ffs | xargs grepc -l ffsll
$
Maybe it was different in the old BSDs; I don't know. If anyone cares,
they could send a patch for a HISTORY section.
>
> Signed-off-by: Elliott Hughes <enh@google.com>
> ---
> man3/ffs.3 | 6 ------
> 1 file changed, 6 deletions(-)
> From 2862b4c94c01fda639fc1dd1fb94479eee1712b9 Mon Sep 17 00:00:00 2001
> From: Elliott Hughes <enh@google.com>
> Date: Mon, 13 Nov 2023 16:46:43 -0800
> Subject: [PATCH] ffs.3: all these functions live in <strings.h>.
>
> In most cases you'll get them transitively through <string.h>, but it's
> misleading for the man page to claim that they're _in_ <string.h>, and
> especially weird to claim they're in _different_ headers from each
> other!
>
> This is also true of Apple's headers, and FreeBSD (the other BSDs only
> have ffs(), not its siblings).
>
> Signed-off-by: Elliott Hughes <enh@google.com>
Patch applied. Thanks!
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=69b9ba5aa108dfdbe7df56b16152e6c90110c6ab>
Cheers,
Alex
> ---
> man3/ffs.3 | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/man3/ffs.3 b/man3/ffs.3
> index 5a5e1c21c..aab5f1099 100644
> --- a/man3/ffs.3
> +++ b/man3/ffs.3
> @@ -22,9 +22,6 @@ Standard C library
> .B #include <strings.h>
> .P
> .BI "int ffs(int " i );
> -.P
> -.B #include <string.h>
> -.P
> .BI "int ffsl(long " i );
> .BI "int ffsll(long long " i );
> .fi
> @@ -87,9 +84,6 @@ T{
> .BR ffsll ()
> T} Thread safety MT-Safe
> .TE
> -.SH VERSIONS
> -BSD systems have a prototype in
> -.IR <string.h> .
> .SH STANDARDS
> .TP
> .BR ffs ()
> --
> 2.42.0.869.gea05f2083d-goog
>
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-14 10:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-14 0:51 [PATCH] ffs.3: all these functions live in <strings.h> enh
2023-11-14 10:20 ` Alejandro Colomar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox