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

c-ares / c-ares / 28707254443
90%

Build:
DEFAULT BRANCH: main
Ran 04 Jul 2026 01:13PM UTC
Jobs 1
Files 177
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

04 Jul 2026 01:10PM UTC coverage: 91.63% (+0.001%) from 91.629%
28707254443

push

github

web-flow
Fix compiler warnings and add CARES_WERROR (enable -Werror in CI on clean toolchains) (#1191)

Fixes the compiler warnings emitted by the high-warning CI builds and
adds a `CARES_WERROR` build option, enabled in CI on the toolchains that
build the library cleanly — so warning regressions can no longer be
merged on those platforms.

## Warning fixes

**`ares_buf.c:1148` `[-Wsign-conversion]`** — emitted by Ubuntu (latest)
and every high-warning build.
- **Origin:** introduced by #1099 (`557139ad`), which changed the offset
calc to `(size_t)(ptr - buf->alloc_buf - buf->offset)`. The inner
subtraction mixes the signed pointer difference with the unsigned
`buf->offset`, implicitly converting signed→unsigned before the outer
cast.
- **Fix:** cast the pointer difference to `size_t` first, then subtract
the (unsigned) offset. Value is unchanged — `ptr` is always `>=
alloc_buf + offset`, so no underflow.

**`ares_event_wake_pipe.c:120` `[-Wunused-result]`** — a plain `(void)`
cast does not silence glibc's `warn_unused_result` on `write()` under
`_FORTIFY_SOURCE`. Consume the result via an (ignored) error check.

## `-Werror` in CI

New `CARES_WERROR` CMake option (default **OFF**). It applies `-Werror`
(GCC/Clang) or `/WX` (MSVC) to the **c-ares library targets only** — not
the test/fuzz harnesses (which carry their own warnings) or CMake's
feature checks.

Enabled (`-DCARES_WERROR=ON`) on toolchains verified warning-free at our
high warning levels:

| Enabled | Compiler |
|---|---|
| ubuntu-latest | gcc 13 / clang 18 |
| fedora-latest | gcc 16 / clang 22 |
| macos, ios | AppleClang 17 |
| openbsd | clang 16 |
| msys2 (MINGW64 / CLANG64) | gcc 16 / clang 22 |
| uwp | MSVC (VS 18) |

**Intentionally excluded:** ubuntu-2004 (gcc 9.4) and centos7 (gcc
4.8.5) — spurious `-Wconversion` at these levels; qnx (vendor QCC),
watcom, djgpp — old/vendor/DOS toolchains with bogus or ABI-specific
warnings.

**Follow-up (not in this PR):** systems with genuine platform-code... (continued)

2 of 3 new or added lines in 2 files covered. (66.67%)

23965 of 26154 relevant lines covered (91.63%)

12244.7 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
94.44
-2.7% src/lib/event/ares_event_wake_pipe.c
Jobs
ID Job ID Ran Files Coverage
1 28707254443.1 04 Jul 2026 01:12PM UTC 940
61.46
GitHub Action Run
Source Files on build 28707254443
  • Tree
  • List 177
  • Changed 56
  • Source Changed 0
  • Coverage Changed 56
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 38d75a0d on github
  • Prev Build on main (#28707169038)
  • Next Build on main (#28719733647)
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