Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

give type with error "error: comparison against null can only be done with optionals" #2104

Closed
shawnl opened this Issue Mar 26, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@shawnl
Copy link
Contributor

shawnl commented Mar 26, 2019

Something like

/home/shawn/git/zig/std/os.zig:764:27: error: only optionals (not [*][*]u8) can compare to null
        while (environ[i] != null) : (i += 1) {
                          ^ 

This information would be useful fixing these type of problems:

pub var posix_environ_maybe: ?[*][*]u8 = null;
        if (posix_environ_maybe) |environ| {
            var i: usize = 0;
            while (environ[i] != null) : (i += 1) {

/home/shawn/git/zig/std/os.zig:764:27: error: comparison against null can only be done with optionals
        while (environ[i] != null) : (i += 1) {
                          ^

@andrewrk andrewrk added this to the 0.5.0 milestone Mar 26, 2019

shawnl added a commit to shawnl/zig that referenced this issue Mar 28, 2019

shawnl added a commit to shawnl/zig that referenced this issue Mar 28, 2019

andrewrk added a commit that referenced this issue Mar 28, 2019

@andrewrk andrewrk modified the milestones: 0.5.0, 0.4.0 Apr 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.