logological / gpp

GPP, a generic preprocessor
https://logological.org/gpp
GNU Lesser General Public License v3.0
197 stars 31 forks source link

Nested #eval causes spurious warning #55

Open DaSpudLord opened 2 years ago

DaSpudLord commented 2 years ago

If any meta-macro that does #eval-style evaluation is nested within any other such meta-macro, GPP prints a warning about attempting to redefine the #defined macro. Seems to be caused by the inner #eval attempting to define the #defined macro while the outer #eval has already done so.

Example Input (directly via terminal, in default mode):

$ gpp
#eval #eval x

Output:

stdin:2: warning: the defined(...) macro is already defined
x

This is in GPP 2.27. Same issue occurs if the input is from a file rather than from stdin.