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

Fix -Wimplicit-function-declaration in md5.c and lam.c #8

Closed
wants to merge 2 commits into from
Closed

Fix -Wimplicit-function-declaration in md5.c and lam.c #8

wants to merge 2 commits into from

Conversation

nmeum
Copy link

@nmeum nmeum commented Oct 22, 2023

This upstreams a patch we had in Alpine downstream for a while.

This patch fixes two implicit function declaration warnings:

  1. lam.c uses recallocarray from recallocarray.c for which no function prototype was provided previously. Similar to reallocarray such a function prototype is now provided in util.h and lam.c has been modified to include this file.
  2. md5.c uses b64_ntop but, contrary to other users of this function (e.g. signify), does not include util.h which provides the function prototype for b64_ntop.

Note that implicit function declarations can affect code generation so it would be cool to get this fixed upstream :)

@nmeum
Copy link
Author

nmeum commented Oct 22, 2023

Just noticed that apart from src/liboutils/include/util.h, reallocarray is also defined in src/liboutils/include/outils.h. Not sure why it is defined in both headers and if the same approach should be taken for recallocarray as well…

Otherwise, causes a -Wimplicit-function-declaration warning. Other
C sources which use b64_ntop include util.h.
and include in in lam.c (only user of this function so far). The same
approach has been taken for reallocarray and this fixes a
-Wimplicit-function-declaration warning.
@leahneukirchen
Copy link
Owner

So the idea is to use -include src/liboutils/outils.h to define all prototypes, so we don't need to touch upstream code files.

@leahneukirchen
Copy link
Owner

Fixed in 50877e1.

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