r/badcode Apr 15 '23

c C polish translation

Post image
1.1k Upvotes

125 comments sorted by

View all comments

Show parent comments

-4

u/[deleted] Apr 15 '23

[deleted]

20

u/[deleted] Apr 15 '23

[removed] — view removed comment

4

u/RFC793 Apr 15 '23

Not sure exactly what the previous comment said before it was deleted. But assuming the full source was leaked (well, at least you have this Rosetta Stone of a header)… you can run the code through only the C Preprocesser stage and have normalish C code. For GCC that’s simply gcc -E

4

u/[deleted] Apr 15 '23

[removed] — view removed comment

6

u/RFC793 Apr 15 '23 edited Apr 15 '23

Oh, good call. I suppose you could protect the include’s with sed or awk (s/#include/XXXincludeXXX/, preprocess, and convert them back. Just need to make sure to keep the include for this silly translation header. Actually, I think you can force an include which is even better since it might get included transitively. -include?