Bug 59660 - mod_macro: Control on bad nesting
Summary: mod_macro: Control on bad nesting
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Other Modules (show other bugs)
Version: 2.5-HEAD
Hardware: All All
: P2 normal with 2 votes (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-03 07:33 UTC by Marc Stern
Modified: 2017-07-28 07:55 UTC (History)
0 users



Attachments
Add directives & flags to control warnings (3.44 KB, patch)
2016-07-06 06:51 UTC, Marc Stern
Details | Diff
Fixed the BOOL case (3.49 KB, patch)
2016-10-05 14:12 UTC, Marc Stern
Details | Diff
Final version compiling on Windows/Linux (3.32 KB, patch)
2016-10-12 11:39 UTC, Marc Stern
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Stern 2016-06-03 07:33:11 UTC
mod_macro checks that nesting is complete inside a macro.
This looks a good default, however there are some cases where we want this and it generates a warning for nothing.
Ex:
   <Macro MyBeginVhost @name @ip_port>
    <VirtualHost @ip_port>
     ServerName @name
     ...
   </Macro>

I'd like to add an option to suppress this warning when we need it.
The simplest option I see would be to add something on the macro definition line itself. Because we may need some other options later, I guess a "flag" would be the most generic approach.
What syntax would be the best one? maybe a (one character) /option after the Macro keyword? Ex: "<Macro/n ...>" (and later "<Macro/ni ..." if we add another flag)
Comment 1 Marc Stern 2016-07-06 06:51:04 UTC
Created attachment 34012 [details]
Add directives & flags to control warnings

MacroIgnoreEmptyArg: globally disable warning about empty arguments.
MacroIgnoreBadNesting: globally disable warning about bad nesting.

/IgnoreEmptyArg & /IgnoreBadNesting: disable warning in one macro definition
Comment 2 Jim Jagielski 2016-10-05 13:53:57 UTC
Patch seems to use 'bool' ??
Comment 3 Marc Stern 2016-10-05 14:12:38 UTC
Created attachment 34326 [details]
Fixed the BOOL case

Add directives & flags to control warnings
Fixed the BOOL case
Comment 4 Marc Stern 2016-10-12 11:39:51 UTC
Created attachment 34365 [details]
Final version compiling on Windows/Linux
Comment 5 fooquency 2017-07-27 14:26:50 UTC
We too would find it very useful to have a directive to hide the empty-argument warning.

For instance, to have an argument for a base URL, sometimes this needs to be a intentionally empty string ("") in the case of a top-level domain installation.

Seeing the warning every time an Apache restart is done is irritating and only obscures real problems.
Comment 6 Marc Stern 2017-07-28 07:55:30 UTC
Fixed in 1770843