...
Non-Compliant Code Example
This code behaves differently when compiled under Linux and Windows.
| Code Block | ||
|---|---|---|
| ||
if (putenv("TEST_ENV=foo") != 0) {
/* Handle Error */
}
if (putenv("Test_ENV=bar") != 0) {
/* Handle Error */
}
temp = getenv("TEST_ENV");
if (temp == NULL) {
/* Handle Error */
}
printf("%s\n",temp);
|
...
On a test IA-32 Linux machine with GCC Compiler Version 3.4.4 this code prints:
...