zig/test/behavior
Andrew Kelley 0e47bd16da add behavior test: return undefined pointer from function
This clarifies that it is legal to return an invalid pointer from a
function, provided that such pointer is not dereferenced.

This matches current status quo of the language. Any change to this
should be a proposal that argues for different semantics.

It is also legal in C to return a pointer to a local. The C backend
lowers such thing directly, so the corresponding warning in C must be
disabled (`-Wno-return-stack-address`).
2025-09-20 17:49:00 -07:00
..
2025-08-11 11:30:51 -07:00
2025-06-16 13:22:19 +03:30
2025-07-25 14:20:23 -04:00
2025-06-16 13:22:19 +03:30
2025-06-16 13:22:19 +03:30
2024-05-11 02:17:24 -07:00
2025-06-16 13:22:19 +03:30
2024-06-13 02:20:47 -07:00
2025-07-27 08:01:07 -04:00
2025-06-16 13:22:19 +03:30
2025-06-16 13:22:19 +03:30
2025-06-16 13:22:19 +03:30
2025-08-07 13:58:49 +02:00
2025-08-01 14:57:16 -07:00
2024-06-13 02:20:47 -07:00
2025-07-27 08:01:07 -04:00