linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dibyendu Majumdar <mobile@majumdar.org.uk>
To: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Another code snippet that Sparse has problems with
Date: Thu, 7 Sep 2017 00:05:58 +0100	[thread overview]
Message-ID: <CACXZuxeoG1v1y8Jm6kHSrFEad0WJo-kaoWk_QbWAM8hn1R_BwQ@mail.gmail.com> (raw)

Hi,

I recently found another test case that fails:

static int test_do(void) {
    int a = 0;
    int count = 27;
    switch (count % 8) {
    case 0: do {  a++;
    case 7:       a++;
    case 6:       a++;
    case 5:       a++;
    case 4:       a++;
    case 3:       a++;
    case 2:       a++;
    case 1:       a++;
            } while ((count -= 8) > 0);
    }
    if (27 != a) return 1;
    return 0;
}

This is a test snippet from 8cc (https://github.com/rui314/8cc) project.


Regards
Dibyendu

             reply	other threads:[~2017-09-06 23:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-06 23:05 Dibyendu Majumdar [this message]
2017-09-07  1:31 ` Another code snippet that Sparse has problems with Luc Van Oostenryck
2017-09-07 10:18   ` Dibyendu Majumdar
2017-09-07 20:22     ` 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=CACXZuxeoG1v1y8Jm6kHSrFEad0WJo-kaoWk_QbWAM8hn1R_BwQ@mail.gmail.com \
    --to=mobile@majumdar.org.uk \
    --cc=linux-sparse@vger.kernel.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 NNTP newsgroup(s).