Hacker News new | ask | show | jobs
by chirsz 222 days ago
The behavior of C macros is actually described by a piece of pseudocode from Dave Prosser and it is not in the standard:

* https://www.spinellis.gr/blog/20060626/

* https://www.spinellis.gr/pubs/jrnl/2006-DDJ-Finessing/html/S...

* https://gcc.gnu.org/legacy-ml/gcc-prs/2001-q1/msg00495.html

4 comments

This is the best explanation I've seen so far:

https://marc.info/?l=boost&m=118835769257658&w=2

This needs to be framed somewhere, very lucid explanation
Wow, I'm not sure I've ever seen this (or if I did, it was 20 years ago).

And I was definitely looking around for this kind of history when I was searching around when writing. Perhaps my google skills have decayed... or google... or both!

Thanks very much.

Oh, are you L33 T.?
If my google fu is that bad, it's pretty much impossible to be.
Oh, I understood you to be saying you'd written this article.
Honestly, it feels like something like this should have been put in the standard instead of all the English prose that ended in the section about the preprocessor expansion. Yeah, it's not pretty, but at least it requires way less skill in hermeneutics to understand correctly.
Thank you very much for providing these links!