public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: DJ Delorie <dj@redhat.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: msebor@gmail.com, libc-alpha@sourceware.org
Subject: Re: [PATCH] improve out-of-bounds checking with GCC 10 attribute access [BZ #25219]
Date: Wed, 06 May 2020 17:08:09 -0400	[thread overview]
Message-ID: <xn8si47ow6.fsf@greed.delorie.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2005062040410.18350@digraph.polyomino.org.uk> (message from Joseph Myers on Wed, 6 May 2020 20:44:38 +0000)

Joseph Myers <joseph@codesourcery.com> writes:
> test-errno.c:122:30: error: argument 1 value -1 is negative [-Werror=stringop-overflow=]

"size" is "int" but passing a negative buffer size?  If gcc knows that
the size is a count of elements, a warning (or error, if -Werror) seems
appropriate (if annoying ;).  However, I can see we're now in the "how
do I dumb down gcc so I can test things I know it knows are errors?"
territory.

Probably a #pramga GCC warning no-stringop-overflow or equivalent for
that whole test.

> test-errno.c:137:30: error: 'readlink' specified size 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]

Here you're passing -1 to a size_t argument, I think that test needs
tweaking anyway.

>   137 |   fails |= test_wrp (EINVAL, readlink, "/", buf, -1);


  reply	other threads:[~2020-05-06 21:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30 22:12 Martin Sebor
2020-04-30 22:37 ` Dmitry V. Levin
2020-05-01  2:42 ` DJ Delorie
2020-05-01 19:54   ` Martin Sebor
2020-05-01 22:02     ` DJ Delorie
2020-05-04 17:34       ` Martin Sebor
2020-05-04 18:40         ` Martin Sebor
2020-05-06 20:44         ` Joseph Myers
2020-05-06 21:08           ` DJ Delorie [this message]
2020-05-06 22:09           ` Martin Sebor
2020-05-06 22:27             ` Joseph Myers

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=xn8si47ow6.fsf@greed.delorie.com \
    --to=dj@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=msebor@gmail.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).