public inbox for cocci@systeme.lip6.fr
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Julia Lawall <julia.lawall@inria.fr>, cocci@inria.fr
Cc: "Derek M. Jones" <derek@knosof.co.uk>,
	Victor Gambier <victor.gambier@inria.fr>
Subject: Re: [cocci] Broken code block size determination in function implementations
Date: Sun, 27 Oct 2024 18:28:15 +0100	[thread overview]
Message-ID: <4893c41d-bdaa-44b9-9381-d04bde2fedd8@web.de> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2410271803580.3498@hadrien>

>> …
>> -> duplicate data
>> file:
>> arch/sh/drivers/pci/common.c
>> function:
>> early_read_config_dword
>> line:
>> 36
>> …
>>
>>
>> https://elixir.bootlin.com/linux/v6.12-rc4/source/arch/sh/drivers/pci/common.c#L33 :
>> …
>> #define EARLY_PCI_OP(rw, size, type)					\
>> int __init early_##rw##_config_##size(struct pci_channel *hose,		\
>> 	int top_bus, int bus, int devfn, int offset, type value)	\
>> {									\
>> 	return pci_##rw##_config_##size(				\
>> 		fake_pci_dev(hose, top_bus, bus, devfn),		\
>> 		offset, value);						\
>> }
>> EARLY_PCI_OP(read, dword, u32 *)
>> EARLY_PCI_OP(write, byte, u8)
> OK, that was much more understandable.  In general, we don't make a great
> effort to give reasonable results for macro definitions.

Under which circumstances can this situation be adjusted better?


> I don't even know what result is wanted?

The discussed source code search should be restricted to function implementations
(which would usually not be generated by special macros).


> The starting position of each EARLY and th ending position of each )?

Obviously, this description does not fit to the desired data processing goal here.


> I guess the problem is that EARLY_PCI_OP is not recognized as a declarer name,

No information “SPECIAL NAMES: adding … as a declarer” was presented for this test case.


> and so a parse error is found,

I did not see such an indication so far.


> causing the macro to be expanded.
The mentioned test output indicated a questionable function name generation.
How will the software understanding evolve further?

Regards,
Markus

  reply	other threads:[~2024-10-27 17:28 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24 11:56 [cocci] Multiple returns significant performance impact Derek M Jones
2024-10-24 12:42 ` Markus Elfring
2024-10-24 14:48 ` Julia Lawall
2024-10-24 15:23   ` Derek M Jones
2024-10-24 15:29     ` Julia Lawall
2024-10-24 15:35       ` Derek M Jones
2024-10-24 15:38         ` Julia Lawall
2024-10-24 15:44           ` Victor Gambier
2024-10-24 16:00             ` Julia Lawall
2024-10-24 15:50           ` Derek M Jones
2024-10-24 16:07             ` Markus Elfring
2024-10-24 16:14               ` Julia Lawall
2024-10-24 16:48             ` Markus Elfring
2024-10-24 17:30             ` Derek M Jones
2024-10-24 18:26               ` Markus Elfring
2024-10-24 21:03                 ` Derek M Jones
2024-10-25  5:38                   ` Markus Elfring
2024-10-25 11:54                     ` Derek M Jones
2024-10-27 12:48                     ` [cocci] Broken code block size determination in function implementations Markus Elfring
2024-10-27 13:31                       ` Julia Lawall
2024-10-27 15:15                         ` Markus Elfring
2024-10-27 16:40                         ` Markus Elfring
2024-10-27 17:05                           ` Julia Lawall
2024-10-27 17:28                             ` Markus Elfring [this message]
2024-10-27 17:34                               ` Julia Lawall
2024-10-27 17:45                                 ` Markus Elfring
2024-10-27 17:55                                   ` Julia Lawall
2024-10-27 18:04                                     ` Markus Elfring
2024-10-27 18:00                                   ` Derek M Jones
2024-10-27 18:11                                     ` [cocci] Evolving experiences from evidence-based software engineering Markus Elfring
2024-10-28  9:00                               ` [cocci] Searching for macro calls besides function implementations (with SmPL)? Markus Elfring
2024-10-28 12:57                                 ` Julia Lawall
2024-10-28 10:44                             ` [cocci] Broken code block size determination in function implementations Markus Elfring
2024-10-29 12:17                             ` Markus Elfring
2024-10-31  7:50                             ` Markus Elfring
2024-10-26 11:43             ` [cocci] Checking SmPL run time characteristics for code block position " Markus Elfring
2024-10-24 16:16           ` [cocci] SmPL position variables … Markus Elfring
2024-10-24 16:20             ` Julia Lawall
2024-10-24 16:28               ` Markus Elfring

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=4893c41d-bdaa-44b9-9381-d04bde2fedd8@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@inria.fr \
    --cc=derek@knosof.co.uk \
    --cc=julia.lawall@inria.fr \
    --cc=victor.gambier@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