public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@xry111.site>
To: Alejandro Colomar <alx.manpages@gmail.com>, libc-alpha@sourceware.org
Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>,
	Carlos O'Donell <carlos@redhat.com>
Subject: Re: [PATCH] libio: Add nonnull attribute for most FILE * arguments in stdio.h
Date: Fri, 19 May 2023 21:03:45 +0800	[thread overview]
Message-ID: <93403e420952c324665840cb924666023d438da4.camel@xry111.site> (raw)
In-Reply-To: <651c313c-edf7-7655-e58b-34d4c22eb34d@gmail.com>

On Fri, 2023-05-19 at 14:40 +0200, Alejandro Colomar wrote:
> On 5/19/23 07:21, Xi Ruoyao via Libc-alpha wrote:
> > On Fri, 2023-05-19 at 12:13 +0800, Xi Ruoyao wrote:
> > > On Thu, 2023-05-18 at 20:29 +0200, Alex Colomar wrote:
> 
> [...]
> 
> > > 
> > > I guess when I took the note on the paper I misspelled "fflush" as
> > > "setbuf" for some reason (maybe lack of coffee :( ).
> > > 
> > > I'll retest all the changes in one hour or two hours.
> > 
> > I've sent v2 with the mistakes in fflush, fflush_unlocked, and
> > setbuf
> > fixed.  Thanks for pointing out my mistake! >
> > I guess I need to avoid creating a patch at 0100 AM in the future
> > :).
> 
> I'm glad to help :-)
> 
> How about fclose(3)?  Was it left out on purpose, or was it a sleep(0)
> issue too? :p

It was done at
https://sourceware.org/git/?p=glibc.git;a=commit;h=71d9e0fe

Actually fclose is the start point of this __nonnull addition:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109570

But unfortunately in Apr I didn't have enough time to check the entire
stdio.h function by function.  Then in the following discussion for the
GCC PR we found ferror should have __nonnull too and I decided to check
all stdio.h functions this time.

> 
> On 5/18/23 20:06, Alex Colomar via Libc-alpha wrote:
>  >> @@ -878,7 +883,7 @@ extern int fileno_unlocked (FILE *__stream)
>  >> __THROW __wur;
>  >>      This function is a possible cancellation point and therefore
> not
>  >>      marked with __THROW.  */
>  >> -extern int pclose (FILE *__stream);
>  >> +extern int pclose (FILE *__stream) __nonnull ((1));
>  >
>  > You didn't patch fclose(3).  Any reason?  I guess it's similarly UB
> to
>  > call fclose(NULL).
> 
> Cheers,
> Alex
> 
> > 
> 
> -- 
> <http://www.alejandro-colomar.es/>
> GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
> 

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

  reply	other threads:[~2023-05-19 13:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18 17:25 Xi Ruoyao
2023-05-18 18:06 ` Alex Colomar
2023-05-18 18:29   ` Alex Colomar
2023-05-19  4:13     ` Xi Ruoyao
2023-05-19  5:21       ` Xi Ruoyao
2023-05-19 12:40         ` Alejandro Colomar
2023-05-19 13:03           ` Xi Ruoyao [this message]
2023-05-19 13:07             ` Alejandro Colomar
2023-05-18 18:56   ` Alejandro Colomar

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

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

  git send-email \
    --in-reply-to=93403e420952c324665840cb924666023d438da4.camel@xry111.site \
    --to=xry111@xry111.site \
    --cc=adhemerval.zanella@linaro.org \
    --cc=alx.manpages@gmail.com \
    --cc=carlos@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /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).