Skip to content

Add missing ARG_ASSERTs; fix .t that wrongly passed#24270

Merged
khwilliamson merged 7 commits intoPerl:bleadfrom
khwilliamson:arg_asserts
Mar 14, 2026
Merged

Add missing ARG_ASSERTs; fix .t that wrongly passed#24270
khwilliamson merged 7 commits intoPerl:bleadfrom
khwilliamson:arg_asserts

Conversation

@khwilliamson
Copy link
Contributor

This adds calls for every function missing a generated ARGS_ASSERT macro, fixing the test that was supposed to find missing ones.

Since, now every generated one has a call, it changes the test to fail on even empty ones, so that new functions added to embed.fnc will need to include the ARGS_ASSERT.

  • This set of changes does not require a perldelta entry.

It was 'M', which is wrong; 'm' is what is meant.  'M' is for when the
implementation is via a macro of a different name.
The normal syntax for the beginning of a function in our C code is to
have the return type on the first line, the function name and parameters
on the second line, and the third line containing a single '{', like so:

 static void
 S_foo(pTHX_ int a)
 {

This commit brings the outliers into compliance with this, except for
some machine generated files.

This makes it easier to grep these.
I grepped through the source to add the ones that are generated but
don't appear.

The intent has been that a Porting test warning gets generated for
missing ones that actually have some effect, but no warning for empty
ones.  However, there is a bug in that test that failed to notice
more than a few non-empty ones.

This commit adds those; the next few commits will fix the test, so this
doesn't happen again.

While we're at it, this commit also adds calls to the empty ones.  They
could become non-empty at any time via changes to the ASSERT macro
generation scheme.
These two patterns were meant to differ only in that one applied to .c
files, and one to inline headers.  But the latter did not contain the
guard that compensated for this test file being run inside t/ vs not.

And it turns out perlstatic.h also contains a function definition.
The first bug was that it didn't realize there could be spaces in the
components of '#define'.  Hence this missed finding some ARGS_ASSERT
definitions

The second bug was that it did not allow for comments on an ARGS_ASSERT
usage line, so it missed finding some uses of these.
A recent commit has added all missing ARGS_ASSERT macros, even when
currently empty.  It's best to always have them.  Change so any future
functions will need to include one.
@jkeenan
Copy link
Contributor

jkeenan commented Mar 14, 2026

This adds calls for every function missing a generated ARGS_ASSERT macro, fixing the test that was supposed to find missing ones.

Since, now every generated one has a call, it changes the test to fail on even empty ones, so that new functions added to embed.fnc will need to include the ARGS_ASSERT.

* This set of changes does not require a perldelta entry.

@khwilliamson I noticed this error output at the end of make test_prep on blead early this evening:

bin/ln -s perldelta.pod pod/perl5439delta.pod
./miniperl -Ilib autodoc.pl 
'save_padsv' missing 'd' flag at embed.fnc, line 3165 at autodoc.pl line 2831.
./miniperl -Ilib pod/perlmodlib.PL -q
./perl -Ilib -I. -f pod/buildtoc -q
cd t && (rm -f perl; /bin/ln -s ../perl perl)

Would this be addressed by the changes in this ticket?

@khwilliamson khwilliamson merged commit a772498 into Perl:blead Mar 14, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants