-
-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://stackoverflow.com/a/54279521 While std::getenv is part of the C++ standard, the putenv function isn't. As you can see from the linked POSIX reference for putenv, it's argument is of type char *. This is very important, and one thing that differs between C and C++: In C a literal string can be passed to functions expecting char *. In C++ all literal strings are constant and can only be passed to functions expecting const char *. Use the itksys::Process::PutEnv wrapper that provides cross platform safe wrappers for setting/getting the environmental variables.
- Loading branch information
1 parent
5b09d54
commit 9309d06
Showing
2 changed files
with
17 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters