(WIP) Remove compat snprintf() and vsnprintf() (eggdrop requires posix 2001) - #1028
Open
michaelortmann wants to merge 4 commits into
Open
michaelortmann wants to merge 4 commits into
michaelortmann wants to merge 4 commits into
Conversation
…rt egg_snprintf() and egg_vsnprintf() for backward compatibility
This was referenced Oct 5, 2020
Merged
michaelortmann
added a commit
to michaelortmann/eggdrop
that referenced
this pull request
Oct 6, 2020
This was referenced Nov 4, 2020
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by: vanosg
Patch by: michaelortmann
Fixes: #226
One-line summary:
Eggdrop depends on POSIX.1-2001. POSIX.1-2001 defines snprintf() and vsnprintf(). This patch gets rid of src/compat/snprintf*. egg_snprintf() and egg_vsnprintf() are left as is, but redefined to directly use snprintf() and vsnprintf() with a one-liner define in eggdrop.h. we only keep egg_snprintf() and egg_vsnprintf() for backward compatibility to (older) modules, and could remove it from later eggdrop versions when api breakage becomes possible.
All egg_snprintf() and egg_vsnprintf() were replaced by snprintf() and vsnprintf():
Note: don't do this in git directory. cd src/ first!
With this PR you must run misc/runautotools and misc/makedepend.
To help with reviewing, i separated the "mass replace with find" into commit d8586f4, everything else i put into commit 9c44751.
This PR is still WIP, because switching to directly using snprintf() helps the compiler analyzing the code and reporting back more warnings. Now i want to check those warning, maybe fix those within this PR. Those compiler warnings are not about new code, or something off with this PR, the code was always there and the same, but compiler warnings were shadowed by our egg_snprintf() magick and now we get to finally see them in all their glory.
Le me know, if you want
(1) me to fix all new compiler warnings within this PR before merging this
(2) me to fix all new compiler warnings in separate PRs, that will look like #1029, before merging this
(3) to merge this PR now (and fix the compiler warnings later)
(4) me to be king of the day again ;)
Additional description (if needed):
Test cases demonstrating functionality (if applicable):