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

build error with -Werror=implicit-function-declaration #49

Open
ametzler opened this issue Mar 25, 2024 · 0 comments
Open

build error with -Werror=implicit-function-declaration #49

ametzler opened this issue Mar 25, 2024 · 0 comments

Comments

@ametzler
Copy link

libspf2 fails to build with -Werror=implicit-function-declaration at

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src/include -I../../src -Werror=implicit-function-declaration -Wall -MT spf_utils.lo -MD -MP -MF .deps/spf_utils.Tpo -c spf_utils.c  -fPIC -DPIC -o .libs/spf_utils.o
spf_utils.c: In function 'SPF_recalloc':
spf_utils.c:207:9: error: implicit declaration of function 'memset' [-Werror=implicit-function-declaration]
  207 |         memset(*bufp, '\0', *buflenp);
      |         ^~~~~~
spf_utils.c:32:1: note: include '<string.h>' or provide a declaration of 'memse'
   31 | #include "spf_internal.h"
  +++ |+#include <string.h>
   32 |
spf_utils.c:207:9: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch]
  207 |         memset(*bufp, '\0', *buflenp);
      |         ^~~~~~
spf_utils.c:207:9: note: include '<string.h>' or provide a declaration of 'memset'
cc1: some warnings being treated as errors

This was originally reported in https://bugs.debian.org/1065792 by Sebastian Ramacher with the remark

I've checked the package and while the file already has #include <memory.h> it has it under #ifdef HAVE_MEMORY_H, and configure doesn't seem to set that define in config.h. So it may be a question of modernizing (they are from 2012) or fixing the autotools files.

We have hotfixed this with the attached trivial patch.
fix-include.patch.txt

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

No branches or pull requests

1 participant