Eric, I wrote: > - provide a documented way to avoid the warning for a particular macro, > I much prefer to have a macro which can be both invoked and required, > even if it requires one more line of code to write it down, than to have > a macro with restricted use.
Here's a concrete proposal: Introduce a new macro-defining-macro AC_DEFUN_IDEMPOTENT, such that: - macros defined with AC_DEFUN_IDEMPOTENT are *known* to be expandable any number of times, hence they may be both invoked and required, - macros defined with AC_DEFUN_ONCE are *known* to be expandable only once, hence the recommendation for them is to AC_REQUIRE them, - about macros defined with AC_DEFUN nothing is known. So for your warning about required-after-expanded it means: - the warning should apply always to AC_DEFUN_ONCEd macros, - the warning should never apply to AC_DEFUN_IDEMPOTENTd macros, - the warning should apply to AC_DEFUNd macros only when the warning level is higher than the default. The warning should indicate that either the double expansion is a problem, or the macro should be changed to be defined with AC_DEFUN_IDEMPOTENT if it is not a problem. Bruno