Coccinelle archive mirror
 help / color / mirror / Atom feed
From: "Simon Chatterjee (sichatte)" <sichatte@cisco.com>
To: "cocci@inria.fr" <cocci@inria.fr>
Subject: [cocci] Same identifier for type and variable
Date: Tue, 12 Nov 2024 16:50:00 +0000	[thread overview]
Message-ID: <SA1PR11MB5828EE32EFC2E3117E464912D5592@SA1PR11MB5828.namprd11.prod.outlook.com> (raw)

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

Thanks for all your work with Coccinelle.

It seems that using the same identifier for an inferred typedef and variable name confuses the parsing heuristics. For example, spatch --parse-c fails with both this:

    typedef int type1;
    typedef int type2;

    void bar (type2 *type1)
    {
        if (type1 != 0) {
        }
    }

and this:

    void foo()
    {
        type1 x;
    }

    void bar (type2 *type1)
    {
        if (type1 != 0) {
        }
    }

Are there any workarounds for this?

Thanks,

Simon


[-- Attachment #2: Type: text/html, Size: 5218 bytes --]

                 reply	other threads:[~2024-11-12 16:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=SA1PR11MB5828EE32EFC2E3117E464912D5592@SA1PR11MB5828.namprd11.prod.outlook.com \
    --to=sichatte@cisco.com \
    --cc=cocci@inria.fr \
    /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).