Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GCC 14 was release on 7th May[^1]. It introduced a new warning `-Wno-calloc-transposed-args`[^2] designd to raise a warning when the arguments to `calloc` were given in the wrong order. Unfortunately, `prism` version `0.24.0` made this mistake. Attempting to `bundle install` Dependabot gives the error: <details> <summary>Error details</summary> ``` src/diagnostic.c: In function ‘pm_diagnostic_list_append’: src/diagnostic.c:328:69: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] 328 | pm_diagnostic_t *diagnostic = (pm_diagnostic_t *) calloc(sizeof(pm_diagnostic_t), 1); | ^~~~~~~~~~~~~~~ src/diagnostic.c:328:69: note: earlier argument should specify number of elements, later size of each element src/diagnostic.c: In function ‘pm_diagnostic_list_append_format’: src/diagnostic.c:359:69: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] 359 | pm_diagnostic_t *diagnostic = (pm_diagnostic_t *) calloc(sizeof(pm_diagnostic_t), 1); | ^~~~~~~~~~~~~~~ src/diagnostic.c:359:69: note: earlier argument should specify number of elements, later size of each element cc1: all warnings being treated as errors ``` </details> The issue was logged upstream in ruby/prism#2645, fixed in ruby/prism#2648, and released in https://github.com/ruby/prism/releases/tag/v0.25.0. This change upgrades `prism`, by way of upgrading `rbi`, and resolves the compile error. [^1]: https://gcc.gnu.org/gcc-14/ [^2]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wno-calloc-transposed-args
- Loading branch information