First thing, I am not looking for a tool that is going to produce an unmaintainable C code from an existing cpp code-base. It is a requirement from a client, so I cannot just use the CPP code base itself.
I am trying to work out a work-flow, so that I can convert the code-base from CPP to C incrementally without breaking the code. I have thought out a few things using the "extern C" approach
Can you folks add anymore ? and point out potential pit-falls ? I cannot share the code-base because of NDA. The code base isn't huge in itself. Its got around 50 cpp files, saw some 100 odd classes.
Thanks in advance.
P.s I have gone through some other questions that sound similar. But they don't really have the work-flow that I am looking for.
[Closing] : Although the post has been put on hold because it is too broad, many of the comments were in fact useful. I am clearer on what needs to be done than before. Thank you.
Well, there's a very long list you'll have to tackle. Without claiming to be complete, you also need:
But don't kid yourself. std::map<std::string, std::pair<int, int>>
is a very straightforward class that stores two ints for each string. The C translation of that class is an outright mess. MyMap["five,three"] = std::make_pair(5,3)
can easily become 100+ lines of C code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With