View Issue Details

IDProjectCategoryView StatusLast Update
00001871003.1(2008)/Issue 7Shell and Utilitiespublic2013-04-16 13:06
ReporterVincent Lefevre Assigned Toajosey  
PrioritynormalSeverityObjectionTypeEnhancement Request
Status ClosedResolutionAccepted As Marked 
NameVincent Lefèvre
OrganizationINRIA
User Reference
Sectionc99
Page Number2489
Line Number79574-79582
Interp StatusApproved
Final Accepted Text0000187:0000322
Summary0000187: Specification of c99 -I option should introduce the concept of system directories
DescriptionPOSIX says: "For headers whose names are enclosed in angle brackets ("<>"), the header shall be searched for only in directories named in -I options and then in the usual places."

However some implementations such as GCC (e.g. used via c99 under Linux) do not behave in that way, and developers regard that as a defect in POSIX. See e.g.

  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40442

which has been closed with the comment "Not a GCC bug, the POSIX list generally agreed the effects of reordering system directories should be unspecified or undefined."
Desired ActionPOSIX should introduce the concept of system directories and say what happens when reordering such directories (e.g. unspecified behavior). However this isn't clear to me, because headers from user/admin-installed libraries are often found in such directories (typically /usr/local/include), and there should also be some standard way to put such directories behind some other ones (e.g. /opt/local/include).
Tagstc1-2008

Activities

geoffclare

2009-11-23 16:21

manager   bugnote:0000308

When this issue was discussed on the mailing list, mention was made of
C99 section 7.1.2 para 3, which says:

    If a file with the same name as one of the above < and > delimited
    sequences, not provided as part of the implementation, is placed
    in any of the standard places that are searched for included
    source files, the behavior is undefined.

(This is preceded by a list of all the standard headers in C99,
within < ... >)

As part of the changes made to address this bug, we should include
something which extends C99 section 7.1.2 para 3 to cover the standard
POSIX headers that are not in C99.

geoffclare

2009-12-04 16:29

manager   bugnote:0000322

Last edited: 2009-12-10 16:14

Interpretation response
------------------------

The standard states the requirements for c99 -I, and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor.

Rationale:
-------------

None.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------

At page 2489 line 79580 after:

    Directories named in -I options shall be searched in the order
    specified.

add:

    If the -I option is used to specify a directory that is one of
    the usual places searched by default, the results are unspecified.

At page 2489 line 79585 after:

    Directories named in -L options shall be searched in the order
    specified.

add:

    If the -L option is used to specify a directory that is one of
    the usual places searched by default, the results are unspecified.

After page 2492 line 79718 add a new unnumbered heading and a new
paragraph:

    Header Search

    If a file with the same name as one of the standard headers
    defined in [xref to XBD section 13], not provided as part of the
    implementation, is placed in any of the usual places that are
    searched by default for headers, the results are unspecified.

Issue History

Date Modified Username Field Change
2009-11-23 04:48 Vincent Lefevre New Issue
2009-11-23 04:48 Vincent Lefevre Status New => Under Review
2009-11-23 04:48 Vincent Lefevre Assigned To => ajosey
2009-11-23 04:48 Vincent Lefevre Name => Vincent Lefèvre
2009-11-23 04:48 Vincent Lefevre Organization => INRIA
2009-11-23 04:48 Vincent Lefevre Section => c99
2009-11-23 04:48 Vincent Lefevre Page Number => 2489
2009-11-23 04:48 Vincent Lefevre Line Number => 79574-79582
2009-11-23 16:21 geoffclare Note Added: 0000308
2009-12-04 16:29 geoffclare Note Added: 0000322
2009-12-10 16:12 geoffclare Interp Status => Pending
2009-12-10 16:12 geoffclare Final Accepted Text => 0000187:0000322
2009-12-10 16:12 geoffclare Status Under Review => Interpretation Required
2009-12-10 16:12 geoffclare Resolution Open => Accepted As Marked
2009-12-10 16:14 geoffclare Note Edited: 0000322
2010-02-12 06:38 ajosey Interp Status Pending => Proposed
2010-03-25 15:18 ajosey Interp Status Proposed => Approved
2010-09-24 14:27 Don Cragun Tag Attached: tc1-2008
2013-04-16 13:06 ajosey Status Interpretation Required => Closed