Re: [PATCH] add usage-strings ci check and amend remaining usage strings
From: Abhradeep Chakraborty <hidden>
Date: 2022-02-22 14:04:39
Julia Lawall wrote:
Of there are some cases that are useful to do statically, with only local information, then using Coccinelle could be useful to get the problem out of the way once and for all. Coccinelle doesn't support much processing of strings directly, but you can always write some python code to test the contents of a string and to create a new one. Let me know if you want to try this. You can also check, eg the demo demos/pythontococci.cocci to see how to create code in a python script and then use it in a normal SmPL rule. ... If the context that you are interested in is in a called function or is in the calling context, then Coccinelle might not be the ideal choice. Coccinelle works on one function at a time, so to do anything interprocedural, you have to do some hacks.
Thank you Julia for this helpful info. Looking at your description, I think the `add check to parse-options.c` (that Ævar suggested as the most ideal method for it) method is more simpler than this. Moreover,as this is only about checking usage-strings, so adding complexity to it will not be a good idea. Thanks :)