Skip to content

checksrc: update, check all sources, fix fallouts - #1457

Closed
vszakats wants to merge 7 commits into
libssh2:masterfrom
vszakats:checkrc-upd
Closed

vszakats wants to merge 7 commits into
libssh2:masterfrom
vszakats:checkrc-upd

Conversation

@vszakats vszakats changed the title checksrc: update, fix fallouts checksrc: update, check all sources, fix fallouts Sep 27, 2024
@vszakats vszakats added the build label Sep 27, 2024
@vszakats

vszakats commented Sep 27, 2024 •

Copy link
Copy Markdown
Member Author

@monnerat: I touched OS/400 sources to make them pass checksrc. Can you take a look if it looks OK? It's whitespace, and sizeof var → sizeof(var), and a FIXME/suppression for vsprintf().

Also VMS, in case anyones sees who can check those.

@vszakats vszakats closed this in 1117b67 Sep 28, 2024
@vszakats
vszakats deleted the checkrc-upd branch September 28, 2024 09:42
@monnerat

monnerat commented Oct 1, 2024

Copy link
Copy Markdown
Contributor

I touched OS/400 sources to make them pass checksrc

Thanks for the "heads-up" and taking care of it, Viktor.
I checked a compilation+run with today's master snapshot and everything is OK.

a FIXME/suppression for vsprintf()

This is not so simple:

  • At the coding time, the *snprintf() functions were not available on OS/400. I had to emulate them and this is why vsprintf() is called here.
  • Nowadays, it seems the EBCDIC runtime library provides them.
  • It also seems ASCII wrappers are provided in the library, but they are not defined in the ASCII version of stdio.h (required since it changes the function name).

So there are 2 possible solutions, each of them having pros and cons:

  1. Live with it as it is: it works although not bound-checked. However a minimum buffer of 4096 is provided, This is the only solution that stays compatible with older OS versions (I don't know when IBM added the *snprintf() functions).
  2. Try to write header definitions for these functions as they are missing from the IBM-provided header. This requires a recent OS (?) and to do some trial/reverse engineering, without being sure it will still be compatible in the future.

Rewriting wrappers doing character code conversion would require format string analysis because we don't know the input parameter types and whether they are intended to be text-formated or not. Much work for a very little added value, indeed :-)

@vszakats

vszakats commented Oct 1, 2024

Copy link
Copy Markdown
Member Author

@monnerat Thanks a lot for verifying, and your input. (Glad to not have broken anything!)

Agreed, writing wrappers is overkill. Adding definitions sounds like a good compromise. If the cutoff version can be figured out and checked for, even better. We can also live with it, and perhaps replace the FIXME with a comment, or your words above.

vszakats pushed a commit that referenced this pull request Oct 2, 2024
Follow-up to discussion in #1457

Plus e-mail address update.

Closes #1462
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants