View Issue Details

IDProjectCategoryView StatusLast Update
00020011003.1(2024)/Issue8Shell and Utilitiespublic2026-10-20 00:06
ReporterLove4Boobies Assigned To 
PrioritynormalSeverityEditorialTypeError
Status NewResolutionOpen 
NameBogdan Barbu
Organization
User Reference
Sectionc17
Page Numberhttps://pubs.opengroup.org/onlinepubs/9799919799/utilities/c17.html
Line NumberSTDOUT section
Interp Status
Final Accepted Text
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.
TagsNo tags attached.

Activities

Love4Boobies

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.

Issue History

Date Modified Username Field Change
2026-10-20 00:03 Love4Boobies New Issue
2026-10-20 00:06 Love4Boobies Note Added: 0007532