Skip to content

mempool.c: fix type signature of emalloc() - #31

Open
orlitzky wants to merge 1 commit into
spamhaus:masterfrom
orlitzky:fix-emalloc-type-sig
Open

mempool.c: fix type signature of emalloc()#31
orlitzky wants to merge 1 commit into
spamhaus:masterfrom
orlitzky:fix-emalloc-type-sig

Conversation

@orlitzky

@orlitzky orlitzky commented Oct 4, 2024

Copy link
Copy Markdown
Contributor

This file declares emalloc() as,

void *emalloc(unsigned size);

whereas the actual implementation of emalloc in rbldnsd_util.c is,

char *emalloc(size_t size);

The mismatch can cause problems for link-time optimization; in particular it causes a warning to be raised -Wlto-type-mismatch. On Gentoo, for example, we encourage users of LTO to build with that warning enabled and promoted to an error.

This file declares emalloc() as,

  void *emalloc(unsigned size);

whereas the actual implementation of emalloc in rbldnsd_util.c is,

  char *emalloc(size_t size);

The mismatch can cause problems for link-time optimization; in
particular it causes a warning to be raised -Wlto-type-mismatch.
On Gentoo, for example, we encourage users of LTO to build with
that warning enabled and promoted to an error.
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.

1 participant