IEEE Standards Interpretation for IEEE Std 1003.1™-2001 IEEE Standard Standard for Information Technology -- Portable Operating System Interface (POSIX®)
Copyright © 2006 by the Institute of Electrical and Electronics Engineers, Inc. 3 Park Avenue New York, New York 10016-5997 USA All Rights Reserved.
Interpretations are issued to explain and clarify the intent of a standard and do not constitute an alteration to the original standard. In addition, interpretations are not intended to supply consulting information. Permission is hereby granted to download and print one copy of this document. Individuals seeking permission to reproduce and/or distribute this document in its entirety or portions of this document must contact the IEEE Standards Department for the appropriate license. Use of the information contained in this document is at your own risk.
IEEE Standards Department Copyrights and Permissions 445 Hoes Lane, Piscataway, New Jersey 08855-1331, USA
Interpretation Request #62
Topic: getenv, static data overwritten Relevant Sections: XSH getenv Page: 510 Line: 16878-16881
"On XSI-conformant systems, the return value from getenv() may point to static data which may also be overwritten by subsequent calls to putenv()."
directly contradicts the earlier statement in the DESCRIPTION:
"The string pointed to may be overwritten by a subsequent call to getenv(), setenv(), or unsetenv(), but shall not be overwritten by a call to any other function in this volume of IEEE Std 1003.1-2001."
(since putenv() is a "function in this volume of IEEE Std 1003.1-2001.")
Also, given the above statement in the DESCRIPTION, this statement in the RETURN VALUE section is redundant:
"The return value from getenv() may point to static data which may be overwritten by subsequent calls to getenv(), setenv(), or unsetenv()."
On line 16867 change "getenv(), setenv(), or unsetenv()" to "getenv(), setenv(), unsetenv(), or putenv()", with "setenv(), unsetenv()" shaded CX and "or putenv()" shaded XSI.
Delete the second and third paragraphs of the RETURN VALUE section (lines 16878-16881).
Interpretation Response #62
The standard is unclear on this issue, and no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor.
Rationale for Interpretation