[SR-9482] Swift's filtering of "header guard" macros is too strict #51944
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
good first issue
Good for newcomers
Additional Detail from JIRA
md5: 01b81c30eea7001ee4aeaf49942f86c3
Issue Description:
The
O_SYNC
macro on Apple platforms is defined in its own file that looks like this:(with an APSL header too)
This pattern is one that Clang can use as a "header guard", to know whether it has to bother re-parsing the file when it's included again later or whether it can just skip it. Usually header guard macros are written explicitly for this purpose, but in this case
O_SYNC
is actually defining a useful constant. We should restrict our check for "header guard" to cases where there's exactly one token, the integer constant "1". (Macros with no expansions are already not imported into Swift.)The text was updated successfully, but these errors were encountered: