3 ms·
[The scandal isn't that we're still using it?] I actually used the fact that: #define return(r) ... only expands for: return (something); and not f
by rwmj 9y ago
[The scandal isn't that we're still using it?]
I actually used the fact that:
#define return(r) ...
only expands for:
return (something);
and not for:
return something;
in a (non-serious non-production) program I wrote. I felt slightly dirty, but it made sense in the context -- tracking stack frames in order to do precise garbage collection of C code.
- naasking 9y agoThat sounds interesting. Any links or a further description?
- rwmj 9y agoNot anything released yet, but the idea is not new. I stole it from OCaml (possibly it came from elsewhere before that): https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#sec423 https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#sec42...
- naasking 9y agoAh, I was thinking it might be a more complex series of tricks to integrate GC more easily with C. For instance, redefining some C keywords, like 'return', to inject a prologue for freeing tagged locals or something.