Skip to content

Conversation

leonerd
Copy link
Contributor

@leonerd leonerd commented Aug 25, 2025

Recently-added code was written largely by copying existing practices in various places. In particular, much of the original code was using UV typed variables to store sizes and indexes in various list or array structures, counts of parameters, and so on.

On fully 64-bit platforms this is all fine, but on 32-bit platforms with -Duse64bitint enabled, this is a 64-bit integer that won't ever be counting that high. These values might as well be stored as 32-bit integers in that case.

  • This set of changes does not require a perldelta entry.

Recently-added code was written largely by copying existing practices in
various places. In particular, much of the original code was using `UV`
typed variables to store sizes and indexes in various list or array
structures, counts of parameters, and so on.

On fully 64-bit platforms this is all fine, but on 32-bit platforms with
-Duse64bitint enabled, this is a 64-bit integer that won't ever be
counting that high. These values might as well be stored as 32-bit
integers in that case.
@tonycoz
Copy link
Contributor

tonycoz commented Aug 26, 2025

You need to change from IVuf (mis-used for UV here) to "%zu" for size_t

B.xs:1184:43: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
 1184 |                 ret = Perl_newSVpvf(aTHX_ "%" IVdf ",%" IVdf,
      |                                           ^~~
 1185 |                                     p->params, p->opt_params);
      |                                     ~~~~~~~~~
      |                                      |
      |                                      size_t {aka unsigned int}
B.xs:1184:43: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
 1184 |                 ret = Perl_newSVpvf(aTHX_ "%" IVdf ",%" IVdf,
      |                                           ^~~
 1185 |                                     p->params, p->opt_params);
      |                                                ~~~~~~~~~~~~~
      |                                                 |
      |                                                 size_t {aka unsigned int}

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