Skip to content

Commit

Permalink
Incorrect warning due to import statement
Browse files Browse the repository at this point in the history
With the Objective C example:
**aa.m**
```
#import "bb.h"
```

**bb.h**
```
#ifndef INCLUDED_OOFUNCTIONATTRIBUTES_h
#endif
```
we get the warning:
```
bb.h:2: Error: More #endif's than #if's found.
```
as the first line of the imported file is read as "comment", by delaying the read this is prevented.
  • Loading branch information
albert-github committed Dec 11, 2023
1 parent ebe22c6 commit 5685f1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pre.l
Expand Up @@ -1210,17 +1210,18 @@ WSopt [ \t\r]*
}
<Include>[^\">\n]+[\">] {
yyextra->incName+=yytext;
readIncludeFile(yyscanner,yyextra->incName);
if (yyextra->isImported)
{
BEGIN(EndImport);
}
else
{
readIncludeFile(yyscanner,yyextra->incName);
BEGIN(Start);
}
}
<EndImport>{ENDIMPORTopt}/\n {
<EndImport>{ENDIMPORTopt}/\n {
readIncludeFile(yyscanner,yyextra->incName);
BEGIN(Start);
}
<EndImport>\\[\r]?"\n" {
Expand Down

0 comments on commit 5685f1e

Please sign in to comment.