Item13374: Parameterized macros cause "Max recursive depth reached" warnings
Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release: n/a
Parameterized macros of multiple layers, (i.e. a macro that uses another) cause "Max recursive depth reached" warning messages in error.log.
As an example:
* Set NONRECURSIVE = %DEFAULT%
* Set REALLYNOT = %NONRECURSIVE{%DEFAULT%}%
%REALLYNOT{foo}%
The above will cause the warning to appear. In my specific case, I have been defining formatting parameterized macros (like NONRECURSIVE above) and linking macros (similar to REALLYNOT above) in WebPreferences for consistent, managed linking and formatting across the web. It seems to work, yet the warning messages appear, at least in the document containing the macro definitions (WebPreferences in this case). The problem seems to be that the parameters in the macro (DEFAULT above) do not get rendered to anything and the _processMacros call from _expandMacroOnTopicRendering keeps trying until it hits $depth (which in this case is always 1).
For more, see the conversation with jmk0 in
http://irclogs.foswiki.org/bin/irclogger_log/foswiki?date=2015-04-14,Tue
--
JohnKnutson - 14 Apr 2015
Analysis is correct, confirmed. Not sure what we can do about this, the recursion is real. The best option would be to suppress macro expansion when rendering
* Set
, but I'm reluctant to do that as it would require adding
* Set
to the syntax recognised by the macro parser, and I suspect the cost of that would be significant (unjustified by this limited case, anyway). For now, putting in a documentation fix.
http://foswiki.org/Support/Faq77
--
CrawfordCurrie - 15 Apr 2015