Interpretations

Answering questions that may arise related to the meaning of portions of an IEEE standard concerning specific applications.

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 #95
Topic: c99 -l operand Relevant Sections: XCU c99

The c99 page states "An operand is either in the form of a pathname or the form -l library." This and other uses of the singular word operand imply that applications (and users) are required to pass "-l library" as a single operand, e.g. by quoting the space in the shell:

$ c99 myfile.c -l\ m

or

$ c99 myfile.c '-l m'

If an application were actually to do that on any system, the result would almost certainly be an error message indicating that the library "-l m" (or "lib m") does not exist.

The text should be updated to make it clear that the -l and the library name are two consecutive operands. The behaviour when the last operand is -l (i.e. no library name is given) should be specified.

Widespread existing practice (for c89, cc, etc.) is to pass a single operand, e.g. "-lm". This usage should also be specified.

The following are all the changes I have identified as being needed in the normative text on the c99 page. The editors may wish to make similar changes in the non-normative text.

On line 8342 change: "An operand is either in the form of a pathname or the form -l ‹i›library‹/i›."

to: "An operand is either in the form of a pathname or the form -l ‹i›library‹/i›, or is one of two consecutive operands of the form -l for the first and ‹i›library‹/i› for the second."

On line 8354 change: "-l ‹i›library‹/i› (The letter ell.) Search the library named:"

to: "-l‹i›library‹/i› (A ‹hyphen›, the letter ell and a library name.) -l ‹i›library‹/i› (Two consecutive operands, the first being a ‹hyphen› and the letter ell; the second being a library name.) Search the library named:"

[add new para before 8356 l213
For the remainder of this description of the c99 utility, both of the forms -l library and -llibrary are referred to as as -l operand for brevity (even though the -l library form is actually two operands).]

On lines 8356-8357 change: "the placement of a -l operand is significant"

to: "the placement of -l‹i›library‹/i› and -l ‹i›library‹/i› operands is significant"

After line 8359 add a new paragraph: "If the last operand is a -l with no library name, then the c99 utility shall write a diagnostic message to standard error and shall return a non-zero exit status."

On line 8411 change: "The c99 utility shall recognize the following -l operands for standard libraries:"

to: "The c99 utility shall recognize the following library operands, both in the form of a single operand -l‹i›library‹/i› and in the form of two consecutive operands -l ‹i›library‹/i›, for standard libraries:"

On lines 8412, 8419, 8421, 8423, 8426, 8429, 8434 and 8439 change: "This operand shall make visible"

to: "Make visible"

On lines 8422 and 8440 change: "through the -l c operand"

to: "through -l c"

On line 8425, 8427, 8433, 8435 and 8437 change: "in the absence of this operand"

to: "in the absence of any operand or operands that specify it"

On line 8436 change: "This operand makes visible"

to: "Make visible"

On line 8442 change: "the equivalent of a -l c operand to be passed to the link editor as the last -l operand"

to: "the equivalent of -l c to be passed to the link editor as the last -l‹i›library‹/i› operand or -l ‹i›library‹/i› operands"

On line 8445 change: "The implementation may accept as -l operands names of objects that do not exist as regular files"

to: "The implementation may accept as -l‹i›library‹/i› or -l ‹i›library‹/i› operands names of objects that do not existas regular files"

Interpretation Response
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
None.