Skip to content

Remove compat vsnprintf() (eggdrop requires posix 2001) - #1523

Merged
vanosg merged 12 commits into
eggheads:developfrom
michaelortmann:vsnprintf
Oct 5, 2026
Merged

vanosg merged 12 commits into
eggheads:developfrom
michaelortmann:vsnprintf

Conversation

@michaelortmann

@michaelortmann michaelortmann commented Jan 11, 2024 •

Copy link
Copy Markdown
Member

Found by: vanosg
Patch by: michaelortmann
Fixes: #226

One-line summary:
Eggdrop depends on POSIX.1-2001, which defines vsnprintf().

Additional description (if needed):
This PR keeps egg_vsnprintf() for backward compatibility to (older) modules but redefines it to use vsnprintf() directly with a one-liner define in eggdrop.h.

All egg_vsnprintf() were replaced by vsnprintf():
find ./ -type f -exec sed -i 's/egg_vsnprintf(/vsnprintf(/g' {} \;
Note: don't do this in git directory. cd src/ first!

Test cases demonstrating functionality (if applicable):
No functional change. I tested 2 share bots, which successfully started and shared userfile.

Comment thread src/modules.c
@thommey

thommey commented Oct 5, 2026

Copy link
Copy Markdown
Member

AI finding:

P2 — The retained snprintf fallback loses its varargs definitions. src/compat/snprintf.c:85–107 still uses HAVE_STDARGS and VA_*, whose definitions this PR deletes. Configure automatically enables BROKEN_SNPRINTF on OSF/1, selecting this fallback even when libc provides snprintf. That path now cannot compile. Preserve the fallback’s standard varargs setup, or explicitly retire the fallback and its configure selection together.

@thommey

thommey commented Oct 5, 2026

Copy link
Copy Markdown
Member

After being told we require C99 and POSIX.2001, AI withdraws its finding and apologizes.

lgtm

@vanosg
vanosg merged commit a9c93db into eggheads:develop Oct 5, 2026
26 checks passed
@michaelortmann
michaelortmann deleted the vsnprintf branch October 6, 2026 22:34
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.

Update non-needed compat code

3 participants