diff --git a/util.c b/util.c index 1f38b5b1150f..c95e764c3458 100644 --- a/util.c +++ b/util.c @@ -2042,18 +2042,30 @@ Perl_warn(pTHX_ const char *pat, ...) } /* -=for apidoc warner +=for apidoc warner =for apidoc_item warner_nocontext +=for apidoc_item vwarner +=for apidoc_item fatal_warner +=for apidoc_item vfatal_warner -These output a warning of the specified category (or categories) given by -C, using the sprintf-style format pattern C, and argument list. +These each output a warning of the specified category (or categories) given by +C, using the sprintf-style format pattern C, and the arguments. C must be one of the C>, C, C, C macros populated with the appropriate number of warning -categories. If any of the warning categories they specify is fatal, a fatal +categories. + +If any of the warning categories they specify is fatal, a fatal exception is thrown. -In any event a message is generated by the pattern and arguments. If the +C and C act as if fatal warnings are enabled +for the warning. If called when there are pending compilation errors these +functions may actually return. They are currently used to generate "used only +once" fatal warnings since the COP where the name being reported is no longer +the current COP when the warning is generated and may be useful for similar +cases. + +In any event, a message is generated by the pattern and arguments. If the message does not end with a newline, then it will be extended with some indication of the current location in the code, as described for L. @@ -2064,9 +2076,13 @@ C is not permitted to be null. __PLAIN_vs_NOCONTEXT_wording__(warner) +The arguments to C and C are specified as a +C. The arguments to the remaining forms are specified as a +sprintf-style list of arguments. + These functions differ from the similarly named C> functions, in that the latter are for XS code to unconditionally display a warning, whereas these -are for code that may be compiling a perl program, and does extra checking to +are for code that may be compiling a perl program, and do extra checking to see if the warning should be fatal. =for apidoc ck_warner @@ -2082,29 +2098,6 @@ categories. The two forms differ only in that C should be used if warnings for any of the categories are by default enabled. -=for apidoc vwarner -This is like C>, but C are an encapsulated argument list. - -=for apidoc fatal_warner - -Like L except that it acts as if fatal warnings are enabled -for the warning. - -If called when there are pending compilation errors this function may -return. - -This is currently used to generate "used only once" fatal warnings -since the COP where the name being reported is no longer the current -COP when the warning is generated and may be useful for similar cases. - -C must be one of the C>, C, C, -C macros populated with the appropriate number of warning -categories. - -=for apidoc vfatal_warner - -This is like C> but C are an encapsulated -argument list. =cut */