public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] testsuite, analyzer: Fix up pipe-glibc.c testcase [PR107396]
Date: Fri, 31 Mar 2023 16:38:22 -0400	[thread overview]
Message-ID: <bc26ab40a7b3cadd008548f5975631a13b4c06b4.camel@redhat.com> (raw)
In-Reply-To: <ZCVCzOdvlQG2Lke7@tucnak>

On Thu, 2023-03-30 at 10:05 +0200, Jakub Jelinek wrote:
> Hi!
> 
> The gcc.dg/analyzer/pipe-glibc.c test FAILs when using recent glibc
> headers
> and succeeds with older headers.
> The important change is that
> https://sourceware.org/git/?p=glibc.git;a=commit;h=c1760eaf3b575ad174fd88b252fd16bd525fa818
> in 2021 added __attribute__ ((__malloc__ (fclose, 1))) attribute to
> fdopen,
> so in write_to_pipe there is an excess warning:
> .../gcc/testsuite/gcc.dg/analyzer/pipe-glibc.c: In function
> 'write_to_pipe':
> .../gcc/testsuite/gcc.dg/analyzer/pipe-glibc.c:28:3: warning: use of
> possibly-NULL 'stream' where non-null expected [CWE-690] [-Wanalyzer-
> possible-null-argument]
> .../gcc/testsuite/gcc.dg/analyzer/pipe-glibc.c:27:12: note: (1) this
> call could return NULL
> .../gcc/testsuite/gcc.dg/analyzer/pipe-glibc.c:28:3: note: (2)
> argument 4 ('stream') from (1) could be NULL where non-null expected
> <built-in>: note: argument 4 of '__builtin_fwrite' must be non-null
> Strangely, nothing is reported on the read_from_pipe function, seems
> fwrite/fprintf/fputc etc. are builtins in GCC and we mark the FILE *
> arguments as nonnull there on the builtin declarations, while
> fgetc/fread
> etc. aren't builtins and glibc doesn't mark any of those using
> nonnull.
> Shall we change that on the glibc side?
> 
> Anyway, because this differs based on glibc version and I think the
> above warning is not the primary intention of the test, I think it is
> best to tweak it so that this warning isn't reported.

[...snip...]

Thanks: the patch LGTM.

Dave




      reply	other threads:[~2023-03-31 20:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30  8:05 Jakub Jelinek
2023-03-31 20:38 ` David Malcolm [this message]

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=bc26ab40a7b3cadd008548f5975631a13b4c06b4.camel@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@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).