summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoichi ITO <koic.ito@gmail.com>2024-03-25 22:23:38 +0900
committergit <svn-admin@ruby-lang.org>2024-03-25 14:11:07 +0000
commit65264b0dfb73a4162b638fa2c9cc0e99c66360e2 (patch)
tree9cbb4316e4cbf77aece5fd38f4b980f4060a9bd9
parent3b4dacf2ede0dafbcf942ac696439237f8b31dc6 (diff)
[ruby/prism] Fix build error for C99 and C23 CI matrix
This PR fixes the following build error for C99 and C23 Ruby's CI matrix: ```console ../src/prism/prism.c:1241:19: error: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] 1241 | char *word = unknown_flags_length >= 2 ? "options" : "option"; | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ assembling ../src/coroutine/amd64/Context.S ``` - c99 ... https://github.com/ruby/ruby/actions/runs/8419905079/job/23053543994#step:10:249 - c23 ... https://github.com/ruby/ruby/actions/runs/8419905079/job/23053544274#step:10:257 This is an incorrect code introduced in https://github.com/ruby/prism/pull/2618. https://github.com/ruby/prism/commit/4d9d73fcb9
-rw-r--r--prism/prism.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/prism/prism.c b/prism/prism.c
index 64f43dcdee..77cbcea2fe 100644
--- a/prism/prism.c
+++ b/prism/prism.c
@@ -1238,7 +1238,7 @@ pm_regular_expression_flags_create(pm_parser_t *parser, const pm_token_t *closin
size_t unknown_flags_length = pm_buffer_length(&unknown_flags);
if (unknown_flags_length != 0) {
- char *word = unknown_flags_length >= 2 ? "options" : "option";
+ const char *word = unknown_flags_length >= 2 ? "options" : "option";
PM_PARSER_ERR_TOKEN_FORMAT(parser, parser->previous, PM_ERR_REGEXP_UNKNOWN_OPTIONS, word, unknown_flags_length, pm_buffer_value(&unknown_flags));
}
pm_buffer_free(&unknown_flags);