View Issue Details

IDProjectCategoryView StatusLast Update
00006501003.1(2008)/Issue 7Shell and Utilitiespublic2019-06-10 08:55
Reporterdalias Assigned Toajosey  
PrioritynormalSeverityEditorialTypeOmission
Status ClosedResolutionAccepted As Marked 
NameRich Felker
Organizationmusl libc
User Reference
Sectionc99
Page Number2489
Line Number79568
Interp Status---
Final Accepted Text0000650:0001486
Summary0000650: c99 -E option fails to define "expanding all preprocessor directives" w.r.t. #pragma
DescriptionPer ISO C, #pragma is a preprocessor directive. However, it does not "expand" to any particular text. Thus, it's unclear what "expanding all preprocessor directives" could mean when a source file contains #pragma.

As far as I know, all existing compilers, when given the -E option, pass #pragma directives through. This seems like the most desirable behavior if the intent is that the preprocessed output can be passed back to the compiler later without the separate preprocessing stage having altered the meaning of the program.
Desired ActionAdd text to specify the behavior of c99 -E with respect to #pragma, either specifying a particular behavior that matches existing implementations or offering a range of behaviors.
Tagstc2-2008

Relationships

parent of 0000667 Closedajosey Add handling of .i files to c99 (c11) in Issue 8 

Activities

geoffclare

2013-03-08 12:16

manager   bugnote:0001486

The following are the changes suggested to fix the #pragma issue in TC2.
Additional changes to address passing preprocessed output back to the
compiler will be proposed in a separate bug targeting Issue 8.

At page 2489 line 79568 section c99 in the -E description change:

    expanding all preprocessor directives

to

    executing all preprocessor directives

At page 2497 line 79928 section c99 add a new paragraph to the end of
the RATIONALE section:

    When the -E option is used, execution of some #pragma preprocessor
    directives may simply result in a copy of the directive being
    included in the output as part of the allowed extra information
    used by subsequent compilation passes (see STDOUT).

Issue History

Date Modified Username Field Change
2013-01-29 00:19 dalias New Issue
2013-01-29 00:19 dalias Status New => Under Review
2013-01-29 00:19 dalias Assigned To => ajosey
2013-01-29 00:19 dalias Name => Rich Felker
2013-01-29 00:19 dalias Organization => musl libc
2013-01-29 00:19 dalias Section => c99
2013-01-29 00:19 dalias Page Number => unknown
2013-01-29 00:19 dalias Line Number => unknown
2013-03-08 12:16 geoffclare Note Added: 0001486
2013-03-08 12:17 geoffclare Page Number unknown => 2489
2013-03-08 12:17 geoffclare Line Number unknown => 79568
2013-03-08 12:17 geoffclare Interp Status => ---
2013-03-08 12:25 geoffclare Relationship added parent of 0000667
2013-03-14 15:15 geoffclare Final Accepted Text => 0000650:0001486
2013-03-14 15:15 geoffclare Status Under Review => Resolved
2013-03-14 15:15 geoffclare Resolution Open => Accepted As Marked
2013-03-14 15:15 geoffclare Tag Attached: tc2-2008
2019-06-10 08:55 agadmin Status Resolved => Closed