4 ms·
Is that all the undefined behaviors? If so, it's an incredibly short list. It must exclude all the accessible undefined OS behaviors.
by thyrsus 4y ago
Is that all the undefined behaviors? If so, it's an incredibly short list. It must exclude all the accessible undefined OS behaviors.
- wahern 4y agoI think the truncate undefined behavior example is an example of OS behavior. On POSIX systems specifying a size greater than the current file size extends the file; it's well-defined[1]. So, presumably, Perl targets some other, non-POSIX operating systems where doing so is undefined. [1] "If the file was previously shorter than length, its size is increased, and the extended area appears as if it were zero-filled." https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html https://pubs.opengroup.org/onlinepubs/9699919799/functions/t... EDIT: Ah, it's VOS: "(VOS) Truncation to same-or-shorter lengths only." https://perldoc.perl.org/perlport#truncate https://perldoc.perl.org/perlport#truncate