View Issue Details

IDProjectCategoryView StatusLast Update
00020011003.1(2024)/Issue8Shell and Utilitiespublic2026-11-04 14:50
ReporterLove4Bobbies Assigned Tomsbrown  
PrioritynormalSeverityEditorialTypeError
Status Interpretation RequiredResolutionAccepted As Marked 
NameBogdan Barbu
Organization
User Reference
Sectionc17
Page Numberhttps://pubs.opengroup.org/onlinepubs/9799919799/utilities/c17.html
Line NumberSTDOUT section
Interp StatusProposed
Final Accepted Text 0002001:0007541
Summary0002001: Zero output after preprocessing on cc17 -E
DescriptionThe -E compiler option POSIX's answer to dependency generation for make, as also explained in the rationale. This report has to do with the description of the -E option in the STDOUT section which is already being amended as per bug report 1925. That amendment does not introduce the issue I am describing here, it inherited it from the current standard, but I thought it was worth pointing out since we have two reports on the same text. With that correction in place, the wording would be as follows:

---
If the -E option is specified, the standard output shall be a text file that represents the results of the preprocessing stage of the language; it may contain extra information appropriate for subsequent compilation passes and shall contain at least one line with the format:

"# %d \"%s\"\n", <line>, <pathname>

or

"# %d \"%s\" %s\n", <line>, <pathname>, <flags>

for each file processed as a result of a #include directive, unless no other output generated from that file is present in the output, where line is a line number, pathname is the pathname used to open the file, and flags is an implementation-defined string.
---

The issue is with the wording "unless no other output generated from that file is present in the output." My reading of this is that if after preprocessing an included header does not output any tokens then -E should ignore it. Consider however the following example:

// foo.h
#define FOO 42

// foo.c
#include "foo.h"

The header produces no output after preprocessing and thus -E will ignore it when used in the process of generating a list of dependencies. Thus foo.h is essentially untracked so if we changed the definition of FOO, a makefile based on the generated dependency list would not know to recompile foo.c
Desired ActionThe bit about headers not producing any headers should simply be stripped unless there is some good reason to keep it there which I am missing.
Tagsissue8

Relationships

related to 0001925 Appliedgeoffclare c17 -E output is incompatible with existing implementations 

Activities

Love4Bobbies

2026-10-20 00:06

reporter   bugnote:0007532

Sorry, I meant to write"the bit about headers not producing any OUTPUT" in the Desired Action field.

msbrown

2026-11-02 16:28

manager   bugnote:0007541

Interpretation response
------------------------
The standard states the output format for c17 -E, 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):
-------------------------------------------------------

On page 2673, lines 88036-88037, after applying 0001925, delete the phrase

unless no other output generated from that file is present in the output,

agadmin

2026-11-04 14:50

administrator   bugnote:0007543

Interpretation Proposed: November 4 2026

Issue History

Date Modified Username Field Change
2026-10-20 00:03 Love4Bobbies New Issue
2026-10-20 00:06 Love4Bobbies Note Added: 0007532
2026-11-02 16:00 nick Relationship added related to 0001925
2026-11-02 16:28 msbrown Assigned To => msbrown
2026-11-02 16:28 msbrown Status New => Interpretation Required
2026-11-02 16:28 msbrown Resolution Open => Accepted As Marked
2026-11-02 16:28 msbrown Interp Status => Proposed
2026-11-02 16:28 msbrown Note Added: 0007541
2026-11-02 16:28 msbrown Tag Attached: issue8
2026-11-04 14:50 agadmin Final Accepted Text => 0002001:0007541
2026-11-04 14:50 agadmin Note Added: 0007543