On Mon, 19 Jul 2021, Martin Sebor via Gcc-patches wrote:

> You've answered my questions about the design (thank you) and I don't
> have any objections to the idea, but I'm not in a position to approve
> the patch.  I would suggest to get Jason's input on extending
> attribute format to variadic function templates, and Joseph's on
> extending it to ordinary (non-variadic) functions.  I've CC'd both.

One design question would be, if you allow this feature, whether it can be 
used in the case where there are no arguments to be formatted, with the 
corresponding attribute argument pointing just after the end of the 
function arguments.  My expectation would be that that case is valid (it 
could be used for a printf-like function that only substitutes no-argument 
formats such as %%), but if the argument number is any greater than that, 
there should be an error.  (And of course there would need to be test 
cases for that in the testsuite, both the valid case and the error for 
larger numbers, and the documentation of format attributes in extend.texi 
would need to describe such cases.)

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to