0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib/std
Hila Friedman bfd2cc5a3f even tighter return type for std.math.sign (#31485)
The code in #31475 does not return the "smallest integer type that fits possible values" for very small integer types, namely `u0`, `i0`, and `i1` - which all end up with a return type one bit too long. Fixed in this commit.

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31485
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: Hila Friedman <red.black.liquorice@gmail.com>
Co-committed-by: Hila Friedman <red.black.liquorice@gmail.com>
History 2026-03-17 02:10:27 +01:00
..
Build rerun fuzz tests from name instead of index 2026-03-11 21:19:22 -04:00
builtin Add lr and sp clobbers for arm/thumb 2026-02-20 01:16:33 +01:00
c std.os.linux: add explicit backing type to packed structs in extern types 2026-03-12 22:33:03 +01:00
compress implement proper deflate flush semantics 2026-03-11 02:28:19 +01:00
crypto std.crypto.argon2: disable flaky test kdf derived key length 2026-03-14 05:55:24 +01:00
debug std: remove default values from ArrayList 2026-03-10 10:26:08 +00:00
dwarf fix compiler ftbfs from std.macho and std.dwarf changes 2025-09-30 13:44:51 +01:00
fmt all: replace all @Type usages 2025-11-22 22:42:38 +00:00
fs compiler,std: fix never-mutated local variables 2026-03-15 18:22:13 +00:00
hash std: remove GeneralPurposeAllocator alias 2026-03-11 01:55:49 +01:00
heap std.heap.ArenaAllocator: relax memory ordering for stealing free list 2026-03-12 21:02:43 +01:00
http std: finish moving time to Io interface 2026-02-02 23:02:31 -08:00
Io add cancelable rwlock functions (#31497) 2026-03-16 23:05:00 +01:00
json Merge pull request 'rework fuzz testing to be smith based' (#31205) from gooncreeper/zig:integrated-smith into master 2026-02-25 20:23:36 +01:00
math std.math.pow: organise and add special case tests 2026-03-16 15:42:35 +08:00
mem std: update for language changes 2026-03-10 10:38:50 +00:00
meta all: replace all @Type usages 2025-11-22 22:42:38 +00:00
os kernel32: another one bytes the dust 2026-03-14 06:06:03 +01:00
posix std.posix: remove close function 2026-02-11 23:37:31 +01:00
process Io.Dispatch: introduce grand central dispatch io impl 2026-02-13 12:29:40 -05:00
Random feat(std.Random): add a linear congruent generator 2026-01-14 12:48:09 +01:00
sort std.sort.pdq: fix out-of-bounds access in partialInsertionSort (#25253) 2025-09-17 19:54:15 -07:00
tar Use / as path separator when writing tar files 2026-03-08 02:10:00 +01:00
Target std.Target.x86: refresh from update_cpu_features.zig 2025-11-13 22:29:28 +01:00
testing rework fuzz testing to be smith based 2026-02-13 22:12:19 -05:00
time removed reduntant @as() from switch in getDaysInMonth 2026-02-05 21:58:35 +01:00
tz Support legacy TZ format, expose header struct to a potential writer 2022-01-01 12:47:08 +00:00
unicode update all occurrences of std.fs.File to std.Io.File 2025-12-23 22:15:07 -08:00
valgrind Remove numerous things deprecated during the 0.14 release cycle 2025-07-11 08:17:43 +02:00
zig detect when switch on error shadows it's own switch case capture 2026-03-17 02:05:31 +01:00
zon std: update for language changes 2026-03-10 10:38:50 +00:00
array_hash_map.zig update deprecated ArrayListUnmanaged usage (#25958) 2025-11-20 14:46:23 -08:00
array_list.zig std.ArrayList: add toOwnedSliceAssert, shrinkToLen. (#30769) 2026-03-12 20:50:27 +01:00
ascii.zig feat(std.ascii): add boundedOrderIgnoreCaseZ 2026-01-17 21:42:38 +01:00
atomic.zig Merge pull request 'std.heap.ArenaAllocator: add fuzz test + some optimizations' (#31407) from justusk/zig:fuzz-arena into master 2026-03-11 03:00:07 +01:00
base64.zig Base64DecoderWithIgnore.calcSizeUpperBound cannot return an error (#25834) 2025-11-07 08:16:34 +01:00
bit_set.zig bit_set: specify the backing integer for IntegerBitSet, allowing it to be used in extern structs 2026-03-16 19:07:13 +01:00
BitStack.zig std.ArrayList: make unmanaged the default 2025-08-11 15:52:49 -07:00
buf_map.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
buf_set.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
Build.zig allow specifying mode in --debug-rt 2026-02-13 17:58:09 -05:00
builtin.zig std: update for language changes 2026-03-10 10:38:50 +00:00
c.zig fix msghdr and cmsghdr on non-Linux targets, document musl behaviour 2026-03-02 17:46:26 +01:00
coff.zig std: replace usages of std.mem.indexOf with std.mem.find 2025-12-05 14:31:27 +01:00
compress.zig std.compress: rework flate to new I/O API 2025-07-31 22:10:11 -07:00
crypto.zig crypto: Allow arbitrary types for secureZeroes 2026-02-13 17:07:03 +01:00
debug.zig Merge pull request 'rework fuzz testing to be smith based' (#31205) from gooncreeper/zig:integrated-smith into master 2026-02-25 20:23:36 +01:00
deque.zig rework fuzz testing to be smith based 2026-02-13 22:12:19 -05:00
DoublyLinkedList.zig *LinkedList.remove() assumes node is in the list 2025-10-25 21:10:02 -07:00
dwarf.zig Dwarf: cleanup emitted debug info 2024-08-22 08:44:08 +02:00
dynamic_library.zig std: move GetFinalPathNameByHandle to Io.Threaded 2026-02-04 16:27:13 -08:00
elf.zig std: work around language changes 2026-03-10 10:26:07 +00:00
enums.zig fix: inline to propagate comptime-ness to call site 2026-03-03 21:10:30 +01:00
fmt.zig std: replace usages of std.mem.indexOf with std.mem.find 2025-12-05 14:31:27 +01:00
fs.zig std: find a better home for the "preopens" concept 2026-01-08 05:06:31 +01:00
gpu.zig remove std.gpu.(binding|location) 2025-12-22 10:00:35 -08:00
hash.zig all: replace all @Type usages 2025-11-22 22:42:38 +00:00
hash_map.zig compiler,std: various little fixes 2026-03-10 10:26:14 +00:00
heap.zig std: remove GeneralPurposeAllocator alias 2026-03-11 01:55:49 +01:00
http.zig update all occurrences of std.fs.File to std.Io.File 2025-12-23 22:15:07 -08:00
Io.zig std.Io: added missing toMicroseconds and fromMicroseconds functions (#30099) 2026-03-12 01:34:40 +01:00
json.zig std.Io: delete GenericReader 2025-08-29 17:14:26 -07:00
leb128.zig std.Io: delete GenericReader 2025-08-29 17:14:26 -07:00
log.zig std.Threaded: replace console kernel32 functions with ntdll 2026-02-05 07:41:25 -05:00
macho.zig std: update for language changes 2026-03-10 10:38:50 +00:00
math.zig even tighter return type for std.math.sign (#31485) 2026-03-17 02:10:27 +01:00
mem.zig std: mem.SplitIterator.peek() can accept a const pointer 2026-03-12 01:35:43 +01:00
meta.zig allow packed union comparisons in std.meta.eql (#31479) 2026-03-12 13:38:06 +01:00
multi_array_list.zig std: update for language changes 2026-03-10 10:38:50 +00:00
os.zig std: start wrangling environment variables and process args 2026-01-04 00:27:07 -08:00
pdb.zig compiler: various lil' fixes 2026-03-10 10:26:14 +00:00
pie.zig std.pie: add missing clobbers on alpha and sparc 2025-11-14 12:19:38 +01:00
posix.zig std.posix: remove close function 2026-02-11 23:37:31 +01:00
priority_dequeue.zig min heap is formed with less than comparison 2026-02-18 13:24:03 -08:00
priority_queue.zig Make std.PriorityQueue an unmanaged container (#31299) 2026-02-26 21:09:52 +01:00
process.zig Io: Add processSetCurrentPath 2026-03-09 03:19:11 +01:00
Progress.zig std.Progress: add Node.startFmt 2026-02-05 16:50:41 -08:00
Random.zig feat(std.Random): add a linear congruent generator 2026-01-14 12:48:09 +01:00
SemanticVersion.zig std: replace usages of std.mem.indexOf with std.mem.find 2025-12-05 14:31:27 +01:00
simd.zig std.simd: suggest 1024-bit vectors for kvx 2025-11-10 09:40:44 +01:00
SinglyLinkedList.zig SinglyLinkedList.remove docs: Assumes -> asserts 2025-10-25 21:28:54 -07:00
sort.zig std.sort.partitionPoint: faster implementation (#30005) 2025-11-27 20:48:54 +01:00
start.zig std.Threaded: replace more kernel32 functions with ntdll 2026-02-07 00:02:50 -05:00
static_string_map.zig std.static_string_map: Cast length of input for runtime initialization 2024-06-20 23:22:39 +00:00
std.zig std: different mechanism for disabling network dependency 2026-03-08 19:20:34 -07:00
tar.zig tar: Fix symlink test when symlinks can't be created on Windows 2026-03-01 15:01:51 -08:00
Target.zig std.Target: update max Linux version to 6.19 2026-02-09 23:54:30 +01:00
testing.zig checkAllAllocationFailures: provide result type to 'extra_args' 2026-03-11 02:32:29 +01:00
Thread.zig std.Threaded: replace more kernel32 functions with ntdll 2026-02-07 00:02:50 -05:00
time.zig std: finish moving time to Io interface 2026-02-02 23:02:31 -08:00
treap.zig std.ArrayList: make unmanaged the default 2025-08-11 15:52:49 -07:00
tz.zig std.tz: fix redundant endian handling 2025-08-28 18:30:57 -07:00
unicode.zig zig build fmt 2026-03-12 17:44:03 -04:00
Uri.zig std: replace usages of std.mem.indexOf with std.mem.find 2025-12-05 14:31:27 +01:00
valgrind.zig remove condition codes 2025-07-16 10:27:39 -07:00
wasm.zig wasm linker: implement @tagName for sparse enums 2025-01-15 15:11:36 -08:00
zig.zig std.zig.putAstErrorsIntoBundle: support zon 2026-03-11 03:01:35 +01:00
zip.zig std: rename other Dir "make" functions to "create" 2025-12-23 22:15:11 -08:00
zon.zig zon: Add anonymous struct literal in the example 2025-08-15 23:35:16 +02:00