unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto via Libc-alpha <libc-alpha@sourceware.org>
To: Florian Weimer <fweimer@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH v2] <stdio.h>: Make fopencookie, vasprintf, asprintf available by default
Date: Thu, 8 Dec 2022 14:08:52 -0300	[thread overview]
Message-ID: <6c3d6c35-69e3-4d2b-2e91-011b160df37f@linaro.org> (raw)
In-Reply-To: <87fse82w0d.fsf@oldenburg.str.redhat.com>



On 24/11/22 12:49, Florian Weimer via Libc-alpha wrote:
> FreeBSD makes these functions available by default, so we should
> not treat them as GNU-specific and restrict them to _GNU_SOURCE.
> 


LGTM, thanks.

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

> ---
> v2: Do not include fcloseall because it's broken.
> 
>  libio/stdio.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libio/stdio.h b/libio/stdio.h
> index 0e0f16b464..10af6d9b60 100644
> --- a/libio/stdio.h
> +++ b/libio/stdio.h
> @@ -42,7 +42,7 @@ __BEGIN_DECLS
>  #include <bits/types/FILE.h>
>  #include <bits/types/struct_FILE.h>
>  
> -#ifdef __USE_GNU
> +#ifdef __USE_MISC
>  # include <bits/types/cookie_io_functions_t.h>
>  #endif
>  
> @@ -294,7 +294,7 @@ extern FILE *fdopen (int __fd, const char *__modes) __THROW
>    __attribute_malloc__ __attr_dealloc_fclose __wur;
>  #endif
>  
> -#ifdef	__USE_GNU
> +#ifdef	__USE_MISC
>  /* Create a new stream that refers to the given magic cookie,
>     and uses the given functions for input and output.  */
>  extern FILE *fopencookie (void *__restrict __magic_cookie,
> @@ -384,7 +384,7 @@ extern int vsnprintf (char *__restrict __s, size_t __maxlen,
>       __THROWNL __attribute__ ((__format__ (__printf__, 3, 0)));
>  #endif
>  
> -#if __GLIBC_USE (LIB_EXT2)
> +#if defined (__USE_MISC) || __GLIBC_USE (LIB_EXT2)
>  /* Write formatted output to a string dynamically allocated with `malloc'.
>     Store the address of the string in *PTR.  */
>  extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
> 
> base-commit: 5bb4b51a76cc9bec72f67f702b5bf2fce30f0f7c
> 

  reply	other threads:[~2022-12-08 17:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24 15:49 [PATCH v2] <stdio.h>: Make fopencookie, vasprintf, asprintf available by default Florian Weimer via Libc-alpha
2022-12-08 17:08 ` Adhemerval Zanella Netto via Libc-alpha [this message]
2023-04-06 15:04   ` Florian Weimer via Libc-alpha

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

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6c3d6c35-69e3-4d2b-2e91-011b160df37f@linaro.org \
    --to=libc-alpha@sourceware.org \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.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 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).