Linux-man Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] regex.3: Remove unnecessary include
@ 2020-10-10 17:50 Alejandro Colomar
  2020-10-10 18:10 ` Alejandro Colomar
  2020-10-11  5:43 ` Michael Kerrisk (man-pages)
  0 siblings, 2 replies; 4+ messages in thread
From: Alejandro Colomar @ 2020-10-10 17:50 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man, Alejandro Colomar

POSIX requires that the <regex.h> header shall define
the structures and symbolic constants used by the
regcomp(),  regexec(), regerror(), and regfree() functions.

Therefore, there should be no need to include <sys/types.h> at all.

The POSIX docs don't use that include:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/regcomp.html

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
---
 man3/regex.3 | 1 -
 1 file changed, 1 deletion(-)

diff --git a/man3/regex.3 b/man3/regex.3
index d4f7a09e7..414011d91 100644
--- a/man3/regex.3
+++ b/man3/regex.3
@@ -32,7 +32,6 @@
 regcomp, regexec, regerror, regfree \- POSIX regex functions
 .SH SYNOPSIS
 .nf
-.B #include <sys/types.h>
 .B #include <regex.h>
 .PP
 .BI "int regcomp(regex_t *" preg ", const char *" regex ", int " cflags );
-- 
2.28.0


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

* Re: [PATCH] regex.3: Remove unnecessary include
  2020-10-10 17:50 [PATCH] regex.3: Remove unnecessary include Alejandro Colomar
@ 2020-10-10 18:10 ` Alejandro Colomar
  2020-10-11  5:44   ` Michael Kerrisk (man-pages)
  2020-10-11  5:43 ` Michael Kerrisk (man-pages)
  1 sibling, 1 reply; 4+ messages in thread
From: Alejandro Colomar @ 2020-10-10 18:10 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man

Hi Michael,

I missed an example about these functions.
I'll send you one next week :)

Cheers

Alex

On 2020-10-10 19:50, Alejandro Colomar wrote:
> POSIX requires that the <regex.h> header shall define
> the structures and symbolic constants used by the
> regcomp(),  regexec(), regerror(), and regfree() functions.
> 
> Therefore, there should be no need to include <sys/types.h> at all.
> 
> The POSIX docs don't use that include:
> https://pubs.opengroup.org/onlinepubs/9699919799/functions/regcomp.html
> 
> Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
> ---
>   man3/regex.3 | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/man3/regex.3 b/man3/regex.3
> index d4f7a09e7..414011d91 100644
> --- a/man3/regex.3
> +++ b/man3/regex.3
> @@ -32,7 +32,6 @@
>   regcomp, regexec, regerror, regfree \- POSIX regex functions
>   .SH SYNOPSIS
>   .nf
> -.B #include <sys/types.h>
>   .B #include <regex.h>
>   .PP
>   .BI "int regcomp(regex_t *" preg ", const char *" regex ", int " cflags );
> 

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

* Re: [PATCH] regex.3: Remove unnecessary include
  2020-10-10 17:50 [PATCH] regex.3: Remove unnecessary include Alejandro Colomar
  2020-10-10 18:10 ` Alejandro Colomar
@ 2020-10-11  5:43 ` Michael Kerrisk (man-pages)
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-10-11  5:43 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

On 10/10/20 7:50 PM, Alejandro Colomar wrote:
> POSIX requires that the <regex.h> header shall define
> the structures and symbolic constants used by the
> regcomp(),  regexec(), regerror(), and regfree() functions.
> 
> Therefore, there should be no need to include <sys/types.h> at all.

Thanls, Alex. Patch applied.

Cheers,

Michael

> The POSIX docs don't use that include:
> https://pubs.opengroup.org/onlinepubs/9699919799/functions/regcomp.html
> 
> Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
> ---
>  man3/regex.3 | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/man3/regex.3 b/man3/regex.3
> index d4f7a09e7..414011d91 100644
> --- a/man3/regex.3
> +++ b/man3/regex.3
> @@ -32,7 +32,6 @@
>  regcomp, regexec, regerror, regfree \- POSIX regex functions
>  .SH SYNOPSIS
>  .nf
> -.B #include <sys/types.h>
>  .B #include <regex.h>
>  .PP
>  .BI "int regcomp(regex_t *" preg ", const char *" regex ", int " cflags );
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

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

* Re: [PATCH] regex.3: Remove unnecessary include
  2020-10-10 18:10 ` Alejandro Colomar
@ 2020-10-11  5:44   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-10-11  5:44 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

On 10/10/20 8:10 PM, Alejandro Colomar wrote:
> Hi Michael,
> 
> I missed an example about these functions.
> I'll send you one next week :)
Sounds good!

Cheers,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-10 17:50 [PATCH] regex.3: Remove unnecessary include Alejandro Colomar
2020-10-10 18:10 ` Alejandro Colomar
2020-10-11  5:44   ` Michael Kerrisk (man-pages)
2020-10-11  5:43 ` Michael Kerrisk (man-pages)

Linux-man Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-man/0 linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ https://lore.kernel.org/linux-man \
		linux-man@vger.kernel.org
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-man


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git