What about pointer arithmetic without decorating everything with "unsafe"? As the whole point is making the code safer.
The point is to reduce the amount of work by doing the boring work automatically. Manually copying struct definitions, functions, etc etc would be very boring but error prone work which is kind of the worst combination.
If that's done you can start improving the codebase module by module.
yeah, preprocessor is going to blow everything, I forgot how good it is. Maybe there's a way by preprocessing and then leaving it as the code, but that wouldn't be as useful and configurable
Rust goes out of the way to make macro safer and less error-prone, which means it will not be able to cover exactly the same especially in some fringe hacky cases
I was commenting along the lines of automatically converting one into another, I find it will either be very difficult or outright impossible without human rewriting the macro from ground up (that is, if we know what problem it solved in the very beginning, otherwise it quickly would become guessing game)
There is the project c2rust which is being used to transpile c projects to rust. I didn't find any mentions on restrictions in this regard but I obviously agree it's a complicated issue.
, which means it will not be able to cover exactly the same especially in some fringe hacky cases
I'm just not sure this is true. Maybe you and I just don't see that there is always an equivalent solution in rust macros even if it's going to be unconventional/unidiomatic use of rust macros?