public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Chih-Hung Hsieh <chh@google.com>
To: elfutils-devel@lists.fedorahosted.org
Subject: Re: [PATCH] Do without on-stack variable length arrays.
Date: Fri, 04 Sep 2015 14:43:49 -0700	[thread overview]
Message-ID: <CAEk9T_3L+5XA4=jGBtw78-0+O97Su_VN=_sKk8pr78HKr_F1Gg@mail.gmail.com> (raw)
In-Reply-To: 20150904205200.0308F2C3B20@topped-with-meat.com

[-- Attachment #1: Type: text/plain, Size: 833 bytes --]

Yes, I shall correct the description.

Is there some simple way that I can test elfutils with fortify or bound
checking tools?

How about using pointers and malloc or alloca, and indexing through the
pointers? That should avoid complaints from stronger bound checkers,
although static bound checking probably won't find bound error either.

Or is there other pattern preferred by elfutils?


On Fri, Sep 4, 2015 at 1:51 PM, Roland McGrath <roland@hack.frob.com> wrote:

> This is misstated.  VLAs are a standard feature.  What you're avoiding here
> is VLA members of structs and unions, which are a GNU extension.
>
> I also don't think you're doing it the ideal way.  A union of two arrays of
> length one is useless.  It might trigger complaints from  _FORTIFY_SOURCE
> or other such bounds-checking tools.
>

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 1234 bytes --]

             reply	other threads:[~2015-09-04 21:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-04 21:43 Chih-Hung Hsieh [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-09-08 21:10 Chih-Hung Hsieh
2015-09-04 22:14 Roland McGrath
2015-09-04 20:51 Roland McGrath
2015-09-04 20:23 Chih-Hung Hsieh

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='CAEk9T_3L+5XA4=jGBtw78-0+O97Su_VN=_sKk8pr78HKr_F1Gg@mail.gmail.com' \
    --to=chh@google.com \
    --cc=elfutils-devel@lists.fedorahosted.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).