Skip to content

Conversation

khwilliamson
Copy link
Contributor

@khwilliamson khwilliamson commented Oct 18, 2025

makedef.pl has to manually be kept in sync with various other pieces of code. This is extra work, and error prone. This commit eliminates that need for embed.fnc syncing.

The relatively new HeaderParser already returns the information we need in its object for each entry. This commit just takes advantage of that, and removes the many lines that were previously needed for this purpose.

Running this under Linux with PLATFORM=test revealed nearly 50 symbols that would have been needlessly exported, such as Perl_grok_bslash_x(), which is only defined in certain files, and not globally.

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

@khwilliamson khwilliamson force-pushed the makedef branch 4 times, most recently from d3aeae7 to c668745 Compare October 19, 2025 13:37
@tonycoz
Copy link
Contributor

tonycoz commented Oct 20, 2025

The O flags says to use 'perl_' instead of 'Perl_' if the p flag is not
also present.  This does that

I see:

:   'O'  Has a perl_ compatibility macro.
:
:        The really OLD name for API funcs.
:
:        autodoc.pl adds a note that the perl_ form of this function is
:        deprecated.

No existing APIs have O without p that I could see, and I don't think we want to encourage new ones.

@tonycoz
Copy link
Contributor

tonycoz commented Oct 20, 2025

iAdd some duplication to makedef.pl from perl.h

typo (extra i) in commit message.

@tonycoz
Copy link
Contributor

tonycoz commented Oct 20, 2025

Running this under Linuxs with PLATFORM=test revealed about a dozen

Linuxs -> Linux?

@khwilliamson
Copy link
Contributor Author

All fixed. I now forbid the O flag without p. This led to removing the special list in regen/embed.pl which merely duplicates the knowledge conveyed by the O flag entries. No need to duplicate this knowledge.

@tonycoz
Copy link
Contributor

tonycoz commented Oct 21, 2025

Otherwise fine

A misspelling and a run-on sentence
And add some comments in embed.fnc
The list consists of exactly the functions that have the O flag set in
embed.fnc.  No need to keep this data twice.  The entries are trivially
generatable from existing entries as we go along

And those generated entries have the added advantage of not using the
short name, so potentially less name space pollution
A future commit will refer to this further below; better to have a name
than $_ for that.
This is so the string doesn't have to be repeated
The 'o' flag requires a Perl_prefix, so shouldn't skip it.  Perhaps it
was a typo, meant to be the 'O' flag.  But that flag now also requires
the p flags, so also a Perl_prefix.
This was in a #ifdef of being in sv.c, which it is, but since it is
public, it needs to be moved out of this.  This removes the need for a
copy of its prototype to be in sv_inline.h
There is unfortunately some duplication required in makedef.pl copied
from perl.h.  This adds some more for two variables, required for the
next commit, which will remove far more lines from makedef.pl than this
adds
makedef.pl has to manually be kept in sync with various other pieces of
code.  It has to know the conditionals that various symbols are compiled
under.  This is extra work, and error prone.  This commit eliminates
that need for embed.fnc syncing.

The relatively new HeaderParser already returns the information about
what conditionals are in effect that we need in its object for each
entry.  This commit just takes advantage of that, and removes the many
lines that were previously needed for this purpose.

Running this under Linux with PLATFORM=test revealed about a dozen
symbols that would have been needlessly exported, such as
Perl_grok_bslash_x(), which is only defined in certain files, and not
globally.
@khwilliamson khwilliamson merged commit f1e500f into Perl:blead Oct 22, 2025
33 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.

2 participants