• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

c-ares / c-ares / 28830262268
90%

Build:
DEFAULT BRANCH: main
Ran 06 Jul 2026 11:29PM UTC
Jobs 1
Files 176
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Jul 2026 11:26PM UTC coverage: 89.979% (+0.03%) from 89.953%
28830262268

push

github

web-flow
Revert "Mark parameters in callbacks as const" (#1060); document non-mutability instead (#1244)

Reverts #1060 ("Mark parameters in callbacks as const") and replaces the
intent with documentation.

## Why revert
#1060 added `const` to the pointer parameters of three public callback
typedefs:
- `ares_callback`: `unsigned char *abuf` → `const unsigned char *abuf`
- `ares_host_callback`: `struct hostent *hostent` → `const struct
hostent *hostent`
- `ares_nameinfo_callback`: `char *node, char *service` → `const char
*node, const char *service`

Changing a callback function pointer's parameter types is an **API/ABI
break**. In C++ especially, function-pointer types must match exactly,
so existing applications that declare their callbacks with the
historical non-const signatures no longer compile against the new
typedefs. This affects real downstream code.

## What this does instead
The buffers *are* read-only and owned by c-ares — but that contract is
now enforced by **documentation, not `const`**:
- Revert the const additions in `include/ares.h`, the man pages, the
internal `nameinfo_callback`, the `ahost` tool, and the tests.
- Add a strong note to each affected man page: the callback **must not**
modify/free the buffer and must not retain it past the callback; it is
intentionally not `const` only to preserve compatibility.
- Add a comment at the callback typedefs in `ares.h` warning not to
re-add `const` (with the reason), so this doesn't get reintroduced.

## Notes
- `include/ares.h`, `src/lib/ares_getnameinfo.c`, `src/tools/ahost.c`
remain whole-file clang-format clean; the one touched `*.h` under
`test/` was formatted on its changed lines only (no whole-file test
reformat).
- Build clean (CMake+Ninja); NameInfo/GetHostByName/GetHostByAddr/Search
suites pass (209 tests).

A matching backport to `v1.34` follows (#1060 was backported there as
well, so 1.34.7 would otherwise ship the break).

24323 of 27032 relevant lines covered (89.98%)

24263.34 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
95.62
-0.4% src/lib/ares_init.c
Jobs
ID Job ID Ran Files Coverage
1 28830262268.1 06 Jul 2026 11:29PM UTC 176
89.98
GitHub Action Run
Source Files on build 28830262268
  • Tree
  • List 176
  • Changed 7
  • Source Changed 3
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28830262268
  • 2c9dc2d3 on github
  • Prev Build on main (#28802494904)
  • Next Build on main (#28831603725)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc