All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dibyendu Majumdar <mobile@majumdar.org.uk>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: sparse-llvm incorrect handling of function pointers
Date: Sat, 11 Mar 2017 11:56:05 +0000	[thread overview]
Message-ID: <CACXZuxfB=2_hdG2XjZwtGzJH429s+1Xy_8JVF+e5Y3-HxMiCdg@mail.gmail.com> (raw)
In-Reply-To: <20170311115418.wwuvklkphmwfzom4@macbook.local>

On 11 March 2017 at 11:54, Luc Van Oostenryck
<luc.vanoostenryck@gmail.com> wrote:
> On Fri, Mar 10, 2017 at 06:13:16PM +0000, Dibyendu Majumdar wrote:
>> Yes, here is an amended test.
>>
>> static int testfunc(int i) {
>>  return i-6;
>> }
>> static int (*f) (int) = testfunc;
>> int main(int argc, const char *argv[]) {
>>  if (f) {
>>   return f(6);
>>  }
>>  else {
>>   return 1;
>>  }
>> }
>
> This one is because of the static initialization.
>

Yes, this works now:

static int testfunc(int i) {
 return i-6;
}
/* initialiser does not work */
/* static int (*f) (int) = testfunc */
static int (*f) (int);
int main(int argc, const char *argv[]) {
 f = testfunc;
 if (f) {
  return f(6);
 }
 else {
  return 1;
 }
}

  reply	other threads:[~2017-03-11 11:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10 14:23 sparse-llvm incorrect handling of function pointers Dibyendu Majumdar
2017-03-10 17:44 ` Luc Van Oostenryck
2017-03-10 18:13   ` Dibyendu Majumdar
2017-03-11 11:54     ` Luc Van Oostenryck
2017-03-11 11:56       ` Dibyendu Majumdar [this message]
2017-03-11 11:58     ` [PATCH] llvm: add script to display the deserialized LLVM IR Luc Van Oostenryck
2017-04-25 20:43       ` Christopher Li
2017-04-26  2:11         ` Luc Van Oostenryck

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='CACXZuxfB=2_hdG2XjZwtGzJH429s+1Xy_8JVF+e5Y3-HxMiCdg@mail.gmail.com' \
    --to=mobile@majumdar.org.uk \
    --cc=linux-sparse@vger.kernel.org \
    --cc=luc.vanoostenryck@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.