<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/84204>84204</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang] Extension: getenv intrinsic
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
DavidTruby
</td>
</tr>
</table>
<pre>
The getcwd intrinsic is an extension provided by some other Fortran compilers (for example [gfortran](https://gcc.gnu.org/onlinedocs/gfortran/GETENV.html)). This extension is used by OpenRadioss.
Arguments:
```
NAME Shall be of type CHARACTER and of default kind.
VALUE Shall be of type CHARACTER and of default kind.
```
Return value:
Stores the value of NAME in VALUE. If VALUE is not large enough to hold the data, it is truncated. If NAME is not set, VALUE will be filled with blanks.
Example:
```
PROGRAM test_getenv
CHARACTER(len=255) :: homedir
CALL getenv("HOME", homedir)
WRITE (*,*) TRIM(homedir)
END PROGRAM
```
This extension seems to be supported by semantics but results in a linker error if used.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVE2PozgQ_TXmUhpEDCThwIHpkJmW-mOVyc4eVwYX4G1jI7tIT__7lSHpGbV2LyNFDtivHq9elUt4r3qDWLL8M8sPkZhpsK48iIuSZzc3b1Fj5Vt5HhB6pPZVgjLklPGqBeVBGMAfhMYra2By9qIkSmjewNsRwdKADo7WkRMGWjtOSqPzwPi-sw7whxgnjcDyz323glh-YHw_EE2epRXjR8aPfdvGvZlj63rGj9ZoZVDa1oejWxg_fqnP9dP3eKBRM14wXsRwHpT_RZ7yMPtV3fOE5iSkst7HLDmwpPp1rVw_j2hokbDub5Prb3l9qh5rlhTfBqE1NAi2A3qbEO6-Vqfq7lyfQBgZdiV2YtYEL8rI64e-Vw9__nbwBx0npNkZuAg947tWAIBvZB16oAHXw0AXRIMysAiI4b5bn4ItxhJo4XoENHbuByALg9VyIZCCBON3oChAyc2mFYRyYVg5VwKPFGAr6atak-uU1ijhVdEAjRbm5eZ3vdb-_xz-4_T85VQ9AqGnv3skNJdbdu8-Mb7XaFh64HnOeAGBK61gsCNK5d7h1cMDXBn4nnH-9fmxZpwHrTcoL27ov0735xoWYMX43bIWcD7dP4a2_ACvnw5wFfqfSazrhy70iKMPBjcIfp4m6-h6Y3AUhlTroZkJHPpZkw8FE6CVeUEH6Jx1oLqljeNIlqks0kJEWG52SbHLtjzbREOZY5ZmPO26pEkKzNtuk7bIW2yKDrnI0kiVPOFZkibbzS5NsiROdrsNT3abjcStLOSWZQmOQulY68sY7l2kvJ-x3Gc8ySItGtR-GRicd1qYPtiZHyJXBvynZu49yxKtPPmfDKRIL1NmjcgPUN88CVVbK_RzuESz0-WHOaBomJu4tSPjx8B7_fs0OfsPtsT4cZEZBsOi9N8AAAD__zlcgyI">