#pragma STDC FP_CONTRACT handler is only registered in parser so we
should keep the unknown STDC pragma through preprocessor and we also
should not emit warning for unknown STDC pragma during preprocessor.
rdar://problem/35724351
Paths
| Differential D41780
Preserve unknown STDC pragma through preprocessor ClosedPublic Authored by steven_wu on Jan 5 2018, 11:17 AM.
Details Summary #pragma STDC FP_CONTRACT handler is only registered in parser so we rdar://problem/35724351
Diff Detail
Event TimelineComment Actions If you move all the #pragma STDC handlers from the lexer to the parser, you might be able to avoid adding an explicit STDC handler in PrintPreprocessedOutput.cpp.
Comment Actions
If it is safe to do that, I can change it. I am not sure if the other STDC pragmas would affect preprocessor output in any other way (which seems not). Comment Actions Should be safe, I think; currently, FENV_ACCESS and CX_LIMITED_RANGE have no effect, and when we do start supporting them, we'll probably want to handle them in the parser, like we do for FP_CONTRACT. This revision is now accepted and ready to land.Jan 5 2018, 2:38 PM Closed by commit rL321909: Preserve unknown STDC pragma through preprocessor (authored by steven_wu). · Explain WhyJan 5 2018, 2:46 PM This revision was automatically updated to reflect the committed changes. steven_wu marked an inline comment as done.
Revision Contents
Diff 128794 include/clang/Basic/DiagnosticLexKinds.td
include/clang/Basic/DiagnosticParseKinds.td
include/clang/Parse/Parser.h
lib/Lex/Pragma.cpp
lib/Parse/ParsePragma.cpp
test/Preprocessor/pragma_unknown.c |
Maybe add CHECK lines to make sure these come out correctly?