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

execl: cast NULL sentinel to (char *), per man page and compiler warning #1998

Merged
merged 2 commits into from Mar 22, 2018

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented Mar 20, 2018

From exec(3):

The list of arguments must be terminated by a null pointer, and, since these
are variadic functions, this pointer must be cast (char *) NULL

From exec(3):

> The list of arguments must be terminated by a null pointer, and, since these
> are variadic functions, this pointer must be cast (char *) NULL
@shlevy
Copy link
Member

shlevy commented Mar 20, 2018

Eh. Can we use nullptr instead?

@dtzWill
Copy link
Member Author

dtzWill commented Mar 20, 2018

I'd imagine so, but not sure! Since I wasn't sure I went with what was explicitly mentioned :).

@shlevy
Copy link
Member

shlevy commented Mar 20, 2018

Does it fix the warning?

@shlevy
Copy link
Member

shlevy commented Mar 20, 2018

(nullptr without a cast, I mean)

@dtzWill
Copy link
Member Author

dtzWill commented Mar 21, 2018

Honestly I don't remember what env was producing the error, but I think nullptr is legit. I'll update with that and see if I can't quickly pull up whatever compiler it was.

@7c6f434c
Copy link
Member

Does Clang support it? I think I have seen a poppler build on Darwin fail because of nullptr today. (I don't use anything Darwin myself)

@shlevy
Copy link
Member

shlevy commented Mar 22, 2018

@7c6f434c yes, clang definitely supports nullptr when compiling C++.

@shlevy shlevy merged commit f66ae22 into NixOS:master Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants