Skip to content

Commit 0e09451

Browse files
committed
perlapi: Combine vwarner and similar with warner entry
This commit places all similar functions into the same entry, making it easier for the reader to choose which is best for their needs.
1 parent 658039d commit 0e09451

File tree

1 file changed

+22
-29
lines changed

1 file changed

+22
-29
lines changed

util.c

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,18 +2042,30 @@ Perl_warn(pTHX_ const char *pat, ...)
20422042
}
20432043

20442044
/*
2045-
=for apidoc warner
2045+
=for apidoc warner
20462046
=for apidoc_item warner_nocontext
2047+
=for apidoc_item vwarner
2048+
=for apidoc_item fatal_warner
2049+
=for apidoc_item vfatal_warner
20472050
2048-
These output a warning of the specified category (or categories) given by
2049-
C<err>, using the sprintf-style format pattern C<pat>, and argument list.
2051+
These each output a warning of the specified category (or categories) given by
2052+
C<err>, using the sprintf-style format pattern C<pat>, and the arguments.
20502053
20512054
C<err> must be one of the C<L</packWARN>>, C<packWARN2>, C<packWARN3>,
20522055
C<packWARN4> macros populated with the appropriate number of warning
2053-
categories. If any of the warning categories they specify is fatal, a fatal
2056+
categories.
2057+
2058+
If any of the warning categories they specify is fatal, a fatal
20542059
exception is thrown.
20552060
2056-
In any event a message is generated by the pattern and arguments. If the
2061+
C<fatal_warner> and C<vfatal_warner> act as if fatal warnings are enabled
2062+
for the warning. If called when there are pending compilation errors these
2063+
functions may actually return. They are currently used to generate "used only
2064+
once" fatal warnings since the COP where the name being reported is no longer
2065+
the current COP when the warning is generated and may be useful for similar
2066+
cases.
2067+
2068+
In any event, a message is generated by the pattern and arguments. If the
20572069
message does not end with a newline, then it will be extended with some
20582070
indication of the current location in the code, as described for L</mess_sv>.
20592071
@@ -2064,9 +2076,13 @@ C<pat> is not permitted to be null.
20642076
20652077
__PLAIN_vs_NOCONTEXT_wording__(warner)
20662078
2079+
The arguments to C<vwarner> and C<vfatal_warner> are specified as a
2080+
C<va_list>. The arguments to the remaining forms are specified as a
2081+
sprintf-style list of arguments.
2082+
20672083
These functions differ from the similarly named C<L</warn>> functions, in that
20682084
the latter are for XS code to unconditionally display a warning, whereas these
2069-
are for code that may be compiling a perl program, and does extra checking to
2085+
are for code that may be compiling a perl program, and do extra checking to
20702086
see if the warning should be fatal.
20712087
20722088
=for apidoc ck_warner
@@ -2082,29 +2098,6 @@ categories.
20822098
The two forms differ only in that C<ck_warner_d> should be used if warnings for
20832099
any of the categories are by default enabled.
20842100
2085-
=for apidoc vwarner
2086-
This is like C<L</warner>>, but C<args> are an encapsulated argument list.
2087-
2088-
=for apidoc fatal_warner
2089-
2090-
Like L</warner> except that it acts as if fatal warnings are enabled
2091-
for the warning.
2092-
2093-
If called when there are pending compilation errors this function may
2094-
return.
2095-
2096-
This is currently used to generate "used only once" fatal warnings
2097-
since the COP where the name being reported is no longer the current
2098-
COP when the warning is generated and may be useful for similar cases.
2099-
2100-
C<err> must be one of the C<L</packWARN>>, C<packWARN2>, C<packWARN3>,
2101-
C<packWARN4> macros populated with the appropriate number of warning
2102-
categories.
2103-
2104-
=for apidoc vfatal_warner
2105-
2106-
This is like C<L</fatal_warner>> but C<args> are an encapsulated
2107-
argument list.
21082101
21092102
=cut
21102103
*/

0 commit comments

Comments
 (0)