perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

Prefer %ll over %L for formatting long long ints

Open t-a-k opened this issue 2 years ago • 4 comments

Configure used to try %L, %q, and then %ll in this order to find the modifier for formatting 64-bit integers on 32-bit machines, but %L for integer conversions (such as in %Ld) seems to be a non-standard GNU extension. I think it will better to try %ll before %q and %L, as %ll is standardized by C99.

t-a-k avatar Aug 23 '22 16:08 t-a-k

Doesnt this need @Tux ?

demerphq avatar Aug 24 '22 09:08 demerphq

Yes, it does. I am trying real hard to catch up currently

Tux avatar Aug 24 '22 09:08 Tux

I'd like to see test-runs on AIX, HP-UX and Solaris. Sadly my resources are currently off-line

Tux avatar Aug 24 '22 09:08 Tux

Otherwise I think this change looks good! Thank you

Tux avatar Aug 24 '22 09:08 Tux

@tux, does that mean we can merge this PR?

demerphq avatar Feb 08 '23 08:02 demerphq

HP-UX and AIX are back on-line. Anyone has time to check them?

Tux avatar Feb 28 '23 17:02 Tux

I tested this on aix with -DUSE_MORE_BITS, and unfortunately all the formats for 32-bit items look like this: #define I32df /**/

khwilliamson avatar Mar 02 '23 04:03 khwilliamson

I have no idea what the final verdict is. Can I merge this now?

Tux avatar Apr 27 '23 09:04 Tux

It doesn't work on aix. @t-a-k please look at this

khwilliamson avatar Apr 27 '23 15:04 khwilliamson

Sorry for delayed response, but I don't have an access to AIX hosts so a bit more information will be helpful.

Does the test pass if configured without -DUSE_MORE_BITS?

t-a-k avatar May 04 '23 16:05 t-a-k

I tried again on AIX, and it worked! I don't know what went wrong before. Sorry.

I think this should be merged in 5.39.1

khwilliamson avatar May 04 '23 21:05 khwilliamson

I tried again on AIX, and it worked!

I'm relieved to hear that.

Anyway this PR should only affect formats for 64-bit integers. If any 32-bit formats such as I32df went wrong, I'm worried that there might be another issue, possibly related to #20415.

t-a-k avatar May 05 '23 02:05 t-a-k