Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ck_warner() more #23137

Merged
merged 1 commit into from
Mar 20, 2025
Merged

Use ck_warner() more #23137

merged 1 commit into from
Mar 20, 2025

Conversation

ilmari
Copy link
Member

@ilmari ilmari commented Mar 19, 2025

Replace trivial uses of

if(ckWARN(WARN_FOO))
    warner(packWARN(WARN_FOO), ...);

with

ck_warner(packWARN(WARN_FOO), ...);

This does mean that the format string arguments get evaluated even if the warning category isn't enabled, but the most expensive thing I could see was Strerror(), which I woudn't worry about.


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

@ilmari ilmari force-pushed the ilmari/more-ck-warner branch from 12473f0 to 579b645 Compare March 19, 2025 11:53
Replace trivial uses of

    if(ckWARN(WARN_FOO))
        warner(packWARN(WARN_FOO), ...);

with

    ck_warner(packWARN(WARN_FOO), ...);

This does mean that the format string arguments get evaluated even if
the warning category isn't enabled, but the most expensive thing I
could see was Strerror(), which I woudn't worry about.
@ilmari ilmari force-pushed the ilmari/more-ck-warner branch from 579b645 to 79bdbfa Compare March 19, 2025 13:05
@jkeenan
Copy link
Contributor

jkeenan commented Mar 19, 2025

I am reluctant to change so many files in the guts at this late point in the 5.41 dev cycle. I recommend that it be marked 'defer-next-dev' and taken up in the 5.43 cycle.

@ilmari
Copy link
Member Author

ilmari commented Mar 20, 2025

I don't see how "number of files" is a useful metric for the riskiness of a change. This is a very low-risk change, it just replaces the manual if (...) warner(...) calls with a function that checks the same condition.

@ilmari ilmari merged commit 9365cdf into blead Mar 20, 2025
67 checks passed
@ilmari ilmari deleted the ilmari/more-ck-warner branch March 20, 2025 15:21
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