Skip to content

Fix use of strchr with new GCC#65

Merged
zandbelt merged 1 commit intoOpenIDC:masterfrom
abbra:fix-discarded-qualifiers
Jan 7, 2026
Merged

Fix use of strchr with new GCC#65
zandbelt merged 1 commit intoOpenIDC:masterfrom
abbra:fix-discarded-qualifiers

Conversation

@abbra
Copy link
Contributor

@abbra abbra commented Jan 7, 2026

According to C specification, 7.28.5.1, strchr() is a generic function and its string argument's type is promoted to the result. So if it is const char*, the result will be const char* as well.

gcc in Fedora Rawhide (15.2.1 20251111 or later) implements this conformance, resulting in a compilation fail with
-Werror=discarded-qualifiers.

According to C specification, 7.28.5.1, strchr() is a generic function
and its string argument's type is promoted to the result. So if it is
const char*, the result will be const char* as well.

gcc in Fedora Rawhide (15.2.1 20251111 or later) implements this
conformance, resulting in a compilation fail with
-Werror=discarded-qualifiers.

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
@zandbelt zandbelt merged commit 48e1fbd into OpenIDC:master Jan 7, 2026
9 of 10 checks passed
@abbra
Copy link
Contributor Author

abbra commented Jan 7, 2026

@zandbelt sorry, this is not full fix. There are few more changes required in tests, I'll submit a separate PR for them.

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.

2 participants