public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: "Joseph S. Myers" <jsm28@cam.ac.uk>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c/4967: GCC should warn about obvious violations of restrict
Date: Wed, 21 Nov 2001 22:56:00 -0000	[thread overview]
Message-ID: <20011129163600.26189.qmail@sourceware.cygnus.com> (raw)

The following reply was made to PR c/4967; it has been noted by GNATS.

From: "Joseph S. Myers" <jsm28@cam.ac.uk>
To: Andreas Jaeger <aj@suse.de>
Cc: <gcc-gnats@gcc.gnu.org>,  <ma@suse.de>,  <gcc-bugs@gcc.gnu.org>, 
     <schwab@suse.de>
Subject: Re: c/4967: GCC should warn about obvious violations of restrict
Date: Thu, 29 Nov 2001 16:29:00 +0000 (GMT)

 On Thu, 29 Nov 2001, Andreas Jaeger wrote:
 
 > whether a call is defined or not.  A call sprintf_restrict (buf, buf)
 > would only be undefined when the function writes to both pointers but
 > this cannot be detected at the call side for e.g. library
 > functions:-(.
 
 Only when it writes to the same object via one pointer as it accesses by
 the other, indeed.  Adding 25 to the second pointer, then copying 25 bytes
 from the first to the second, or something more complicated where each
 byte is only accessed via one of the pointers, would still be OK.
 
 You could always work out some way to annotate function declarations with
 information about how much is read or written from each argument and
 whether aliasing is OK (note that the restrict qualifiers in declarations
 not part of the definition are still irrelevant and are effectively
 ignored (6.7.5.3#15), but you could define them to be relevant in
 interpreting such an attribute).  I'd like to get -Wformat-security to
 warn about sprintf into fixed-length buffers that might be too short for
 the format, and similar such possible security holes.
 
 -- 
 Joseph S. Myers
 jsm28@cam.ac.uk
 


             reply	other threads:[~2001-11-29 16:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-21 22:56 Joseph S. Myers [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-11-21 22:59 aj
2001-11-21 22:57 Andreas Jaeger
2001-11-21 22:49 aj
2001-11-21 21:36 Andreas Jaeger
2001-11-21 21:36 Andreas Jaeger
2001-11-21 21:27 Joseph S. Myers
2001-11-21 21:18 Andreas Jaeger
2001-11-21 21:16 Joseph S. Myers
2001-11-21 21:15 Andreas Jaeger

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=20011129163600.26189.qmail@sourceware.cygnus.com \
    --to=jsm28@cam.ac.uk \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.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).