Thank you for the links - I went over docs, related tutorials etc. It's a great tool indeed but it's a tool for C.
OsmoPCU is written in C++ which is supported in spatch only at rudimentary level. Moreover, the OsmoPCU code actively mixes C and C++. All-in-all I did not managed to find a way to apply changes both to headers and the code at the same time.
For example, attached semantic patch properly updates all the invocations on alloc_algorithm*() but not the definitions so the result is uncompilable.
So the question is, how shall I proceed with spatch? - apply what's possible and do the rest manually? - don't use it at all for c++?
Of course it might as well be the case that the patch is wrong or that I'm calling spatch in a wrong way: spatch --c++ --dir src -I src --sp-file alloc.spatch --in-place --recursive-includes
Ideas, opinions are greatly appreciated.
On 23.09.2017 06:47, Harald Welte wrote:
http://cgit.osmocom.org/osmo-trx/commit/?id=e210f1a864b0752f5baeb14de8ddcfc7...
http://coccinelle.lip6.fr/sp.php - no sure if we want to replicate that in the osmocom wiki.