zig/lib
eric-saintetienne c3faae6bf1
format: do not force user to provide an alignment field when it's not necessary (#19049)
* format: fix default character when no alignment

When no alignment is specified, the character that should be used is the
fill character that is otherwise provided, not space.

This is closer to the default that C programmers (and other languages)
use: "04x" fills with zeroes (in zig as of today x:04 fills with spaces)

Test:

    const std = @import("std");
    const expectFmt = std.testing.expectFmt;

    test "fmt.defaultchar.no-alignment" {

        // as of today the following test passes:
        try expectFmt("0x00ff", "0x{x:0>4}", .{255});

        // as of today the following test fails (returns "0x  ff" instead)
        try expectFmt("0x00ff", "0x{x:04}", .{255});
    }

* non breaking improvement of string formatting

* improved comment

* simplify the code a little

* small improvement around how  characters identified as valid are consumed
2024-07-17 19:02:10 +00:00
..
compiler - Added special handling for translating C extern variables declared within scoped blocks 2024-07-16 23:29:44 +03:00
compiler_rt Update __chkstk_ms to have weak linkage (#20138) 2024-07-11 20:20:06 +00:00
docs Autodoc: only group structs under "namespaces" 2024-07-09 15:58:03 -04:00
include update C language headers to LLVM 18 2024-05-08 19:37:28 -07:00
init add a missing comment in build.zig.zon 2024-07-15 10:47:36 -07:00
libc glibc headers: arc4random* functions added in glibc 2.36 2024-07-03 02:57:24 -04:00
libcxx update libcxx and libcxxabi to llvm 18.1.6 2024-05-20 16:12:36 -04:00
libcxxabi update libcxx and libcxxabi to llvm 18.1.6 2024-05-20 16:12:36 -04:00
libunwind libunwind: update to LLVM 18 2024-05-08 19:37:29 -07:00
std format: do not force user to provide an alignment field when it's not necessary (#19049) 2024-07-17 19:02:10 +00:00
tsan tsan: update rtl files to LLVM 17.0.6 2024-01-10 01:00:37 -07:00
c.zig std.builtin: make link mode fields lowercase 2024-03-11 07:09:10 -07:00
compiler_rt.zig stage2-wasm: bit_reverse 2024-06-16 11:53:33 +02:00
zig.h zig.h: expand zig_msvc_atomic_load_ into version for relaxed, acquire, and seq_cst 2024-07-13 19:45:45 -04:00