Skip to content

hostip: remove unused MAX_HOSTCACHE_LEN and MAX_DNS_CACHE_SIZE#21550

Closed
amitbidlan wants to merge 1 commit into
curl:masterfrom
amitbidlan:hostip-remove-dead-macros
Closed

hostip: remove unused MAX_HOSTCACHE_LEN and MAX_DNS_CACHE_SIZE#21550
amitbidlan wants to merge 1 commit into
curl:masterfrom
amitbidlan:hostip-remove-dead-macros

Conversation

@amitbidlan
Copy link
Copy Markdown

These macros are leftovers from 96d5b5c (dnscache: own source file, improvements) which split DNS caching out of hostip.c into lib/dnscache.c. Both macros are still defined and used in dnscache.c; the copies in hostip.c are no longer referenced anywhere.

Detected by building with clang -Wunused-macros on macOS.

These macros are leftovers from when DNS caching was moved out of
hostip.c into its own source file. Both are still defined and used in
lib/dnscache.c; the copies in lib/hostip.c are unreferenced.

Detected with clang -Wunused-macros.

Follow-up to 96d5b5c
@github-actions github-actions Bot added the name lookup DNS and related tech label May 11, 2026
@bagder bagder closed this in e0e56e9 May 11, 2026
@bagder
Copy link
Copy Markdown
Member

bagder commented May 11, 2026

Thanks!

vszakats added a commit that referenced this pull request May 15, 2026
Also fix fallouts found.

Windows clang-tidy CI job is a little pickier than I'd prefer due to the
`_CURL_TESTS_CONCAT=ON` option used there, and all macros considered
local, thus checked by the compiler. Upside: it revealed macro usage
dynamics in tests. If too annoying, `first.h` may be opted-out from the
concat logic. Some macros may also be deleted instead of `#if 0`-ing.

Follow-up to e0e56e9 #21550
Follow-up to 5fa5cb3 #20593

Closes #21554
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
These macros are leftovers from when DNS caching was moved out of
hostip.c into its own source file. Both are still defined and used in
lib/dnscache.c; the copies in lib/hostip.c are unreferenced.

Detected with clang -Wunused-macros.

Follow-up to 96d5b5c
Closes curl#21550
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
Also fix fallouts found.

Windows clang-tidy CI job is a little pickier than I'd prefer due to the
`_CURL_TESTS_CONCAT=ON` option used there, and all macros considered
local, thus checked by the compiler. Upside: it revealed macro usage
dynamics in tests. If too annoying, `first.h` may be opted-out from the
concat logic. Some macros may also be deleted instead of `#if 0`-ing.

Follow-up to e0e56e9 curl#21550
Follow-up to 5fa5cb3 curl#20593

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

Labels

name lookup DNS and related tech

Development

Successfully merging this pull request may close these issues.

2 participants