Skip to content

Remove excess error from config#4151

Merged
Earlopain merged 1 commit into
ruby:mainfrom
Earlopain:remove-excess-error
Jul 6, 2026
Merged

Remove excess error from config#4151
Earlopain merged 1 commit into
ruby:mainfrom
Earlopain:remove-excess-error

Conversation

@Earlopain

Copy link
Copy Markdown
Collaborator

Seems to have been left unused since 8266572

Now this causes build failures in windows CI, not sure why only now:

src/diagnostic.c:781:46: error: array subscript 329 is above array bounds of 'const pm_diagnostic_data_t[329]' [-Werror=array-bounds=]
compiling build/shared/integer.o
  781 |     const char *message = diagnostic_messages[diag_id].message;
compiling build/shared/json.o
      |                           ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
compiling build/shared/line_offset_list.o
src/diagnostic.c: In function 'pm_diagnostic_list_append':
src/diagnostic.c:97:35: note: while referencing 'diagnostic_messages'
   97 | static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = {
      |                                   ^~~~~~~~~~~~~~~~~~~

@Earlopain Earlopain force-pushed the remove-excess-error branch 2 times, most recently from b835b96 to ae8cba3 Compare June 29, 2026 18:01
@Earlopain

Copy link
Copy Markdown
Collaborator Author

Hm, I thought it would be related to this, but I guess not

@Earlopain Earlopain marked this pull request as ready for review June 29, 2026 18:01
@Earlopain

Copy link
Copy Markdown
Collaborator Author

So, removing these two asserts:

assert(diag_id < PM_DIAGNOSTIC_ID_MAX);

assert(diag_id < PM_DIAGNOSTIC_ID_MAX);

Resolves the error. That doesn't make a whole lot of sense to me. Do you have an idea @kddnewton?

@Earlopain Earlopain marked this pull request as draft July 1, 2026 07:16
@kddnewton

Copy link
Copy Markdown
Collaborator

Looking into this now

@kddnewton

Copy link
Copy Markdown
Collaborator

Proving to GCC that it's okay seemed to work (#4158)

@kddnewton kddnewton closed this Jul 5, 2026
@kddnewton

Copy link
Copy Markdown
Collaborator

If you want to reopen with just removing the dead diagnostics that'd be fine

@Earlopain Earlopain reopened this Jul 6, 2026
@Earlopain Earlopain force-pushed the remove-excess-error branch from 479bd64 to ae8cba3 Compare July 6, 2026 09:03
`ARGUMENT_BLOCK_FORWARDING` seems to have been left unused since ruby@8266572
The other I didn't find (possible I missed it)
@Earlopain Earlopain force-pushed the remove-excess-error branch from ae8cba3 to 1847189 Compare July 6, 2026 09:05
@Earlopain Earlopain marked this pull request as ready for review July 6, 2026 09:05
@Earlopain

Copy link
Copy Markdown
Collaborator Author

Weird, wish I knew why that's needed but I suppose its fine. Almost seems like a compiler bug but I'm not going to setup windows to investigate that. Thanks for handling.

@Earlopain Earlopain merged commit b8f076a into ruby:main Jul 6, 2026
61 checks passed
matzbot pushed a commit to ruby/ruby that referenced this pull request Jul 6, 2026
(ruby/prism#4151)

`ARGUMENT_BLOCK_FORWARDING` seems to have been left unused since ruby/prism@8266572
The other I didn't find (possible I missed it)

ruby/prism@b8f076a61c
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