Re: Bash printf should diagnose integer overflow

2024-03-22 Thread Chet Ramey
On 3/22/24 2:40 AM, Paul Eggert wrote: $ diff -u :check[34].log --- :check3.log    2024-03-21 14:09:48.069094929 -0700 +++ :check4.log    2024-03-21 22:39:51.391869014 -0700 @@ -327,6 +327,10 @@  warning: UNIX versions number signals and schedule processes differently.  warning: If output

Re: Bash printf should diagnose integer overflow

2024-03-22 Thread Paul Eggert
On 2024-03-21 13:31, Chet Ramey wrote: Interesting. I can't reproduce this. Using the commit to which your patches apply, without applying any of them, on a fresh Virtualbox Fedora 39 install, I get consistent `make tests' output every time. I just now tried the latest devel commit

Re: Bash printf should diagnose integer overflow

2024-03-21 Thread Chet Ramey
On 3/19/24 11:48 PM, Paul Eggert wrote: On 3/18/24 12:41, Chet Ramey wrote: I'm not sure what you're using, but that was not my experience on macOS. I am using Fedora 39 (the current version) on x86-64. That could explain our differing experiences. I see several diagnostics (mostly diff

Re: Bash printf should diagnose integer overflow

2024-03-19 Thread Paul Eggert
On 3/18/24 12:41, Chet Ramey wrote: I'm not sure what you're using, but that was not my experience on macOS. I am using Fedora 39 (the current version) on x86-64. That could explain our differing experiences. I see several diagnostics (mostly diff output) with "make check" on Fedora 39.

Re: Bash printf should diagnose integer overflow

2024-03-18 Thread Chet Ramey
On 3/18/24 3:41 PM, Chet Ramey wrote: It should be mostly there in the changes I pushed today, once I made it through the above. I appreciate the work you did. Using the ckd_* macros is the right approach. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars

Re: Bash printf should diagnose integer overflow

2024-03-18 Thread Chet Ramey
On 3/18/24 12:36 PM, Paul Eggert wrote: On 3/18/24 07:40, Chet Ramey wrote: Thanks for the patches. They introduce a number of regressions, some due to the different overflow handling; several not. I urge everyone who submits non-trivial patches to run the test suite (`make tests') on their

Re: Bash printf should diagnose integer overflow

2024-03-18 Thread Paul Eggert
On 3/18/24 07:40, Chet Ramey wrote: Thanks for the patches. They introduce a number of regressions, some due to the different overflow handling; several not. I urge everyone who submits non-trivial patches to run the test suite (`make tests') on their patched versions before sending them in. I

Re: Bash printf should diagnose integer overflow

2024-03-18 Thread alex xmb sw ratchev
On Mon, Mar 18, 2024, 15:40 Chet Ramey wrote: > On 3/13/24 8:57 PM, Paul Eggert wrote: > > > Revised patchset attached. The first patch uses the fix you suggested; > the > > remaining patches are similar to what I sent earlier, except the last > one > > is simplified since it doesn't need to

Re: Bash printf should diagnose integer overflow

2024-03-18 Thread Chet Ramey
On 3/13/24 8:57 PM, Paul Eggert wrote: Revised patchset attached. The first patch uses the fix you suggested; the remaining patches are similar to what I sent earlier, except the last one is simplified since it doesn't need to worry about inline width and precision when printf will do the

Re: Bash printf should diagnose integer overflow

2024-03-13 Thread Paul Eggert
On 3/13/24 11:13, Chet Ramey wrote: Thanks for the report. The most appropriate fix for this particular issue is to display an error message if printf returns < 0, instead of suppressing it unless the -v option has been set. Oh, good point. This simplifies things a bit, though Bash still

Re: Bash printf should diagnose integer overflow

2024-03-13 Thread Chet Ramey
On 3/12/24 3:49 PM, Paul Eggert wrote: Bash Version: 5.3 Patch Level: 26 Release Status: devel Description: Commands like "printf '%1s' ''" silently ignore width and precision.  They should report the integer overflow before continuing with a lesser

Bash printf should diagnose integer overflow

2024-03-12 Thread Paul Eggert
Configuration Information: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 uname output: Linux penguin.cs.ucla.edu 6.7.7-200.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Mar 1 16:53:59 UTC 2024 x86_64 GNU/Linux Machine Type: x86_64-redhat-linux-gnu Bash Version: 5.3 Patch