After this commit there are no more bit rotted files.
The testing program that was in ir.zig has been moved to main.zig
Unsupported command line options have been deleted, or error messages
added.
The compiler repl is available from the build-exe, build-lib,
build-obj commands with the --watch option.
The main zig build script now builds the self-hosted compiler
unconditionally. Linking against LLVM is behind a -Denable-llvm
flag that defaults to off.
According to documentation ETIMEDOUT (110) is a valid error code for the read function. I just had my long-running (been running for about 7 weeks) network program crash because it did not handle the ETIMEDOUT error code from "read".
This new name (and the fact that it is a function returning a type) will
make it more clear which use cases are better suited for ArrayList and
which are better suited for ArrayListSentineled.
Also for consistency with ArrayList,
* `append` => `appendSlice`
* `appendByte` => `append`
Thanks daurnimator for pointing out the confusion of std.Buffer.
This caused link errors in c++ code because it was not correct to pass
these flags to child codegens. And that was the only reason to detect
these flags. Otherwise we can safely rely on non-explicitly-detected
flag forwarding.
This is only the first step; it makes zig cc recognize -z and append it to the linker args, but the linker arg parsing doesn't support -z yet so it will just give the warning 'unsupported linker arg: -z'
* `-isystem` instead of `-I` for system include directories
fixes a problem with native system directories interfering with zig's
bundled libc.
* separate Stage2Target.is_native into Stage2Target.is_native_os and
Stage2Target.is_native_cpu.
* The generated options data file is sorted now in a way that
makes sure longer prefixes are first. This prevents collisions
with some parameters.
* Add support for `-fPIC`, `-fno-PIC`, `-nostdlib`, `-shared`,
`-rdynamic`, `-Wl,-soname`, `-Wl,-rpath`
* Better support for `-o`.
* Disable generating h files
* Shared library support.
* Better positional argument support.
* remove deprecated `std.fs.Dir` APIs
* `std.fs.Dir.openDir` now takes a options struct with bool fields for
`access_sub_paths` and `iterate`. It's now much more clear how
opening directories works.
* fixed the std lib and various zig code calling the wrong openDir
function.
* the runtime safety check for dir flags is removed in favor of the
cheaper option of putting a comment on the same line as handling
EBADF / ACCESS_DENIED, since that will show up in stack traces.
* `std.Buffer.print` is removed; use `buffer.outStream().print`
* `std.fmt.count` returns a `u64`
* `std.Fifo.print` is removed; use `fifo.outStream().print`
* `std.fmt.bufPrint` error is renamed from `BufferTooSmall`
to `NoSpaceLeft` to match `std.os.write`.
* `std.io.FixedBufferStream.getWritten` returns mutable buffer
if the buffer is mutable.