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

ldns: fix the build in FreeBSD's base system #214

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

khorben
Copy link

@khorben khorben commented May 23, 2023

This adds an ldns/internal.h C header, containing a copy of the function prototypes for internal functions not exposed in the API.

It effectively works around the following compilation error: error: no previous prototype for function [-Werror,-Wmissing-prototypes]

This header is not installed, and does not affect the API exposed.

Tested on FreeBSD/amd64 (14.0-CURRENT).

Note that this was performed on version 1.8.3, but it seems that it still applies in the same way in the develop branch.

This adds a copy of the function prototypes for internal functions where
necessary.

It effectively works around the following compilation error:
error: no previous prototype for function [-Werror,-Wmissing-prototypes]

Tested on FreeBSD/amd64 (14.0-CURRENT).
ldns/internal.h Outdated

/* util.c */
struct tm *
ldns_serial_arithmetics_gmtime_r(int32_t time, time_t now, struct tm *result);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already declared in <ldns/util.h>.

ldns/internal.h Outdated

/* dnssec_zone.c */
ldns_status
dnssec_zone_equip_zonemd(ldns_dnssec_zone *zone,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want to remove the prototype in dnssec_sign.c.

ldns/internal.h Outdated

/* net.c */
int
ldns_tcp_bgsend2(ldns_buffer *qbin,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are already declared in <ldns/net.h>.

ldns/internal.h Outdated

/* rr.c */
ldns_status
_ldns_rr_new_frm_fp_l_internal(ldns_rr **newrr, FILE *fp,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want to remove the prototypes in zone.c and dnssec_zone.c.

ldns/internal.h Outdated

/* edns.c */
void
ldns_edns_set_code(ldns_edns_option *edns, ldns_edns_option_code code);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These aren't used outside edns.c and should simply be made static.

ldns/internal.h Outdated
ldns_serial_arithmetics_gmtime_r(int32_t time, time_t now, struct tm *result);
#undef ldns_serial_arithmitics_gmtime_r
struct tm *
ldns_serial_arithmitics_gmtime_r(int32_t time, time_t now, struct tm *result);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentionally not declared anywhere, if you want to silence the warning you should place a prototype right before the definition.

@khorben khorben force-pushed the khorben/freebsd-build-fix branch from c57f822 to 2779d15 Compare May 23, 2023 18:49
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.

None yet

2 participants