unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] <string.h>: Make strchrnul, strcasestr, memmem available by default
@ 2022-11-24 14:32 Florian Weimer via Libc-alpha
  2022-12-08 17:07 ` Adhemerval Zanella Netto via Libc-alpha
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Weimer via Libc-alpha @ 2022-11-24 14:32 UTC (permalink / raw)
  To: libc-alpha

FreeBSD makes them available by default, too, so there does not seem
to be a reason to restrict these functions to _GNU_SOURCE.

Tested on x86_64-linux-gnu.

---
 string/string.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/string/string.h b/string/string.h
index 54dd8344de..bfeeeb2eb4 100644
--- a/string/string.h
+++ b/string/string.h
@@ -274,7 +274,7 @@ extern char *strrchr (const char *__s, int __c)
      __THROW __attribute_pure__ __nonnull ((1));
 #endif
 
-#ifdef __USE_GNU
+#ifdef __USE_MISC
 /* This function is similar to `strchr'.  But it returns a pointer to
    the closing NUL byte in case C is not found in S.  */
 # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
@@ -368,7 +368,7 @@ extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
      __THROW __nonnull ((2, 3));
 #endif
 
-#ifdef __USE_GNU
+#ifdef __USE_MISC
 /* Similar to `strstr' but this function ignores the case of both strings.  */
 # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++" char *strcasestr (char *__haystack, const char *__needle)
@@ -382,7 +382,7 @@ extern char *strcasestr (const char *__haystack, const char *__needle)
 # endif
 #endif
 
-#ifdef __USE_GNU
+#ifdef __USE_MISC
 /* Find the first occurrence of NEEDLE in HAYSTACK.
    NEEDLE is NEEDLELEN bytes long;
    HAYSTACK is HAYSTACKLEN bytes long.  */

base-commit: a46956e65d037358161e7512a9f0fd408ea1333a


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

* Re: [PATCH] <string.h>: Make strchrnul, strcasestr, memmem available by default
  2022-11-24 14:32 [PATCH] <string.h>: Make strchrnul, strcasestr, memmem available by default Florian Weimer via Libc-alpha
@ 2022-12-08 17:07 ` Adhemerval Zanella Netto via Libc-alpha
  2023-04-06 15:04   ` Florian Weimer via Libc-alpha
  0 siblings, 1 reply; 3+ messages in thread
From: Adhemerval Zanella Netto via Libc-alpha @ 2022-12-08 17:07 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha



On 24/11/22 11:32, Florian Weimer via Libc-alpha wrote:
> FreeBSD makes them available by default, too, so there does not seem
> to be a reason to restrict these functions to _GNU_SOURCE.
> 
> Tested on x86_64-linux-gnu.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> 
> ---
>  string/string.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/string/string.h b/string/string.h
> index 54dd8344de..bfeeeb2eb4 100644
> --- a/string/string.h
> +++ b/string/string.h
> @@ -274,7 +274,7 @@ extern char *strrchr (const char *__s, int __c)
>       __THROW __attribute_pure__ __nonnull ((1));
>  #endif
>  
> -#ifdef __USE_GNU
> +#ifdef __USE_MISC
>  /* This function is similar to `strchr'.  But it returns a pointer to
>     the closing NUL byte in case C is not found in S.  */
>  # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
> @@ -368,7 +368,7 @@ extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
>       __THROW __nonnull ((2, 3));
>  #endif
>  
> -#ifdef __USE_GNU
> +#ifdef __USE_MISC
>  /* Similar to `strstr' but this function ignores the case of both strings.  */
>  # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
>  extern "C++" char *strcasestr (char *__haystack, const char *__needle)
> @@ -382,7 +382,7 @@ extern char *strcasestr (const char *__haystack, const char *__needle)
>  # endif
>  #endif
>  
> -#ifdef __USE_GNU
> +#ifdef __USE_MISC
>  /* Find the first occurrence of NEEDLE in HAYSTACK.
>     NEEDLE is NEEDLELEN bytes long;
>     HAYSTACK is HAYSTACKLEN bytes long.  */
> 
> base-commit: a46956e65d037358161e7512a9f0fd408ea1333a
> 

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

* Re: [PATCH] <string.h>: Make strchrnul, strcasestr, memmem available by default
  2022-12-08 17:07 ` Adhemerval Zanella Netto via Libc-alpha
@ 2023-04-06 15:04   ` Florian Weimer via Libc-alpha
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Weimer via Libc-alpha @ 2023-04-06 15:04 UTC (permalink / raw)
  To: Adhemerval Zanella Netto; +Cc: libc-alpha

* Adhemerval Zanella Netto:

> On 24/11/22 11:32, Florian Weimer via Libc-alpha wrote:
>> FreeBSD makes them available by default, too, so there does not seem
>> to be a reason to restrict these functions to _GNU_SOURCE.
>> 
>> Tested on x86_64-linux-gnu.
>
> LGTM, thanks.
>
> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

Thanks, finally pushed this after re-testing.

Florian


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

end of thread, other threads:[~2023-04-06 15:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-24 14:32 [PATCH] <string.h>: Make strchrnul, strcasestr, memmem available by default Florian Weimer via Libc-alpha
2022-12-08 17:07 ` Adhemerval Zanella Netto via Libc-alpha
2023-04-06 15:04   ` Florian Weimer via Libc-alpha

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