|
From: | Eric Blake |
Subject: | Re: [PATCH v9 34/34] iotests: Add tests for qcow2 images with extended L2 entries |
Date: | Mon, 6 Jul 2020 08:57:43 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 |
On 7/3/20 8:06 AM, Alberto Garcia wrote:
+ printf -v expected_bitmap "%llu" $expected_bitmap # Convert to unsignedDoes the length modifier “ll” actually do anything?+ + printf "L2 entry #%d: 0x%016lx %016lx\n" "$entry_no" "$entry" "$bitmap"Or the “l” here?Actually they don't (I just tested in i386 and x86_64), I assumed that it would require the length modifiers like in C. I'm tempted to leave them for clarity (using 'll' in both cases), opinions?
POSIX doesn't require support for modifiers; %d and %lld are the same even in 32-bit bash. If this is a #!/bin/bash script, then use it for clarity; if it is #!/bin/sh, omit it for portability.
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |