Skip to content

Commit eb87a4a

Browse files
committed
perldelta for year of ExtUtils::ParseXS changes
Add a perldelta entry mentioning that ParseXS has been heavily refactored over the last year. I haven't been adding entries for each monthly release as it was a work in progress, and most changes weren't externally visible. It's still a work in progress, but I'm intending to defer any further changes until after the 5.42.0 release, so now seems good time for the perldelta entry.
1 parent a2492d6 commit eb87a4a

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

pod/perldelta.pod

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,38 @@ On platforms that don't support Inf/NaN values in floating-point numbers (such
171171
as VAX), C<builtin::inf> and C<builtin::nan> now throw a runtime error (rather
172172
than breaking the perl build). [GH #22882]
173173

174+
=item *
175+
176+
L<ExtUtils::ParseXS> has been extensively refactored internally and
177+
extensive tests have been added. Most of these changes shouldn't be
178+
visible externally with a few exceptions, the main ones being:
179+
180+
The generated C code, especially for returning values, may have changed
181+
slightly, and in some cases be slightly more efficient (in particular,
182+
using TARG more often to return a value rather than creating a new
183+
temporary).
184+
185+
The parser is more likely to give warnings now on XS errors which
186+
previously would have just silently generated invalid C code.
187+
188+
One XS bug has been fixed in a way that may be highly visible. Previously
189+
when parsing the parameters of an XS sub declaration, if a parameter
190+
couldn't be parsed, it was quietly ignored. This meant that it would still
191+
consume an argument, but wouldn't declare a C variable: a bit like the
192+
Perl-level C<my ($a, undef, $c) = @_>. Now, it gives a compile error. This
193+
will break XS code that does (for example):
194+
195+
void
196+
foo(int a, /* skip arg */, int c)
197+
198+
because C-comments aren't part of XS syntax, and so the parameter was a
199+
syntax error and was quietly skipped. This is better written as
200+
201+
void
202+
foo(int a, b, int c)
203+
204+
since parameters which are not assigned a type act as placeholders.
205+
174206
=back
175207

176208
=head2 Removed Modules and Pragmata

0 commit comments

Comments
 (0)