Re: [cocci] Search for the concatenation of meta variable + fixed string

Markus Elfring <[email protected]>
Newsgroups fr.inria.cocci
Message-ID <[email protected]>
> Found a workaround using fresh identifier to add an intermediate helper construct:

Please reconsider your solution approach once more.


> @device_attr_ro@
> declarer name DEVICE_ATTR_RO;
> typedef __DEVICE_ATTR_RO_T;
> identifier attr_name;
> fresh identifier show_fn_name = attr_name ## "_show";
> @@
>   DEVICE_ATTR_RO(attr_name);
> + __DEVICE_ATTR_RO_T attr_name = show_fn_name;

Would you really like to modify source code here?

Are you more interested in an “ordinary” source code search?


> Seems to work good enough. If there are cleaner ways, let me know.

I suggest to take another look at algorithmic properties.

Would you need to extract identifiers from selected macro calls?

Regards,
Markus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.