Skip to content

Fix calloc-transposed-args warning#520

Merged
tompng merged 1 commit intoruby:masterfrom
nobu:calloc-transposed-args
Apr 6, 2026
Merged

Fix calloc-transposed-args warning#520
tompng merged 1 commit intoruby:masterfrom
nobu:calloc-transposed-args

Conversation

@nobu
Copy link
Copy Markdown
Member

@nobu nobu commented Apr 6, 2026

ntt.h: In function ‘ntt_multiply’:
ntt.h:136:41: warning: ‘ruby_xcalloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
  136 |     uint32_t *mem = ruby_xcalloc(sizeof(uint32_t), ntt_size * 9);
      |                                         ^~~~~~~~
ntt.h:136:41: note: earlier argument should specify number of elements, later size of each element

```
ntt.h: In function ‘ntt_multiply’:
ntt.h:136:41: warning: ‘ruby_xcalloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
  136 |     uint32_t *mem = ruby_xcalloc(sizeof(uint32_t), ntt_size * 9);
      |                                         ^~~~~~~~
ntt.h:136:41: note: earlier argument should specify number of elements, later size of each element
```
@nobu nobu requested a review from tompng April 6, 2026 13:53
@tompng tompng merged commit 48b2adc into ruby:master Apr 6, 2026
84 checks passed
@nobu nobu deleted the calloc-transposed-args branch April 7, 2026 00:51
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