Coccinelle archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Florian Stinglmayr <florian.stinglmayr@proton.me>, cocci@inria.fr
Subject: Re: [cocci] Bug: cocci seems to have issues with math expression in struct initialisers
Date: Tue, 18 Mar 2025 16:43:52 +0100	[thread overview]
Message-ID: <ccd65b9a-caaf-4852-bda3-cab980a42b58@web.de> (raw)
In-Reply-To: <Cj-R4IgEgd_zgRLBVFxVy7ffXmhDSmTrxrSQhr83u3Lf9M8N9dEBDK8M_idtO0mGjO480pEeMHrQHH4xWmQn1uSwLUHW-jXSt0mlIy_HiNY=@proton.me>

>> rect_t dst = { SYMBOLA * SYMBOL_WIDTH, 0, 0, 0 };
> cocci complains about the code around multiplicator in the structure initialiser.

The test case can be simplified another bit.

Another source file example:
my_structure x = { 2 * 3, 0 };


Questionable test result (with the software combination “Coccinelle 1.3-00083-g4093aad2d”):
Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> spatch --parse-c test1-multiplication_in_structure_initialiser.c
…
(ONCE) CPP-TYPEDEF: promoting:(201) my_structure on line 1
-----------------------------------------------------------------------
NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100%
nb good = 0,  nb passed = 0 =========> -nan% passed
nb good = 0,  nb bad = 0 =========> -nan% good or passed


Regards,
Markus

      reply	other threads:[~2025-03-18 15:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18 11:48 [cocci] Bug: cocci seems to have issues with math expression in struct initialisers Florian Stinglmayr
2025-03-18 15:43 ` Markus Elfring [this message]

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=ccd65b9a-caaf-4852-bda3-cab980a42b58@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@inria.fr \
    --cc=florian.stinglmayr@proton.me \
    /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).