Hi José,
I'm not sure if this is the best way to do it. Looking through the existing extraction mechanism looked a bit "hacky" in my personal opinion. I thought I could reduce complexity very much using a compiler tracer.
The approach of the tracer feels right to me, since extracting and executing are not done in the same macros/functions. This would separate the two functionalities more and would lead to cleaner and more understandable code.
I value your opinion very much in this discussion, especially since I have no experience with the tracer. Do you think this might be a legit use case?
What are the risks, if a compiler tracer can evaluate/execute arguments?
I agree, that executing functions inside the users codebase might be unexpected to the user and should probably be discouraged except when the user is made aware of this fact. Reading "scalar" values however, should not be an issue.
For example, I think a static analyzer could greatly profit from evaluating arguments to a function. (one example could be sobelow checking what headers were passed to the "put_secure_headers" plug)
If you think this is a good idea, I would offer to actually work on this :)
Best,
Jonatan