Skip to content

Fix -Werror build failure in apr_uri.c where memchr() preserves const - #77

Closed
notroj wants to merge 1 commit into
apache:trunkfrom
notroj:uri-memchr-const
Closed

notroj wants to merge 1 commit into
apache:trunkfrom
notroj:uri-memchr-const

Conversation

@notroj

@notroj notroj commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

The Linux CI jobs which build with -Werror currently fail on trunk:

uri/apr_uri.c: In function 'detect_scope_zone_id':
uri/apr_uri.c:106:7: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]

detect_scope_zone_id() assigns the result of memchr() on a const char * to a char *. With a C library where memchr() preserves the const qualifier of its argument, that is a warning, and so an error with -Werror.

The pointer is only read through, so it is now declared const char *. This was the only such warning in a full build here (Fedora 44); testuri passes.

This does not address the Windows "Use Libxml2" and "Static: All" jobs, which fail in their Test step on trunk for a different reason.

🤖 Generated with Claude Code

* uri/apr_uri.c (detect_scope_zone_id): Const-correct s.

uri/apr_uri.c: In function 'detect_scope_zone_id':
uri/apr_uri.c:106:7: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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