Hacker News new | past | comments | ask | show | jobs | submit login

Why all the printf copy/pasta around the opcode enum?

Can't the author use pre-processor string concatenation to write once and then leverage that to map enum to string and back?

At least I'm doing that in a little scripting language parser and it looks portable.

Edit: I'm actually using pre-processor string concatenation for something unrelated. You don't even need that to do the mapping.




c4 is meant to be self-hosted and it does not implement a preprocessor. It was easier to re-use printf creatively.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: