This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 194769 - Unfair parsing of headers problem
Summary: Unfair parsing of headers problem
Status: RESOLVED WONTFIX
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
: 151175 151271 159229 186064 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-27 12:44 UTC by nnnnnk
Modified: 2012-10-30 21:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nnnnnk 2011-01-27 12:44:59 UTC
For performance reasons we do not reparse headers when compiler does.
So we have some specific inaccuracy issues.
This is umbrella bug for this kind of issues.
Comment 1 nnnnnk 2011-01-27 12:45:44 UTC
There are unresolved ids in sequentially included headers.

newfile1.h
#include <vector>
using namespace std;
newfile.h
int foo() {
    vector<int> v; // unresolved
}
newfile.cpp
#include "newfile1.h"
#include "newfile.h"
int main(){
    return 0;
}
Comment 2 nnnnnk 2011-01-27 12:46:24 UTC
*** Bug 151175 has been marked as a duplicate of this bug. ***
Comment 3 nnnnnk 2011-01-27 12:46:53 UTC
Example:
file1.cpp:
#define MACRO namespace N1 {
#include "newfile.h"
MACRO
      A a;
}
file2.cpp:
#define MACRO namespace N1 {
#include "newfile.h"
MACRO
      A a;
}
newfile.h:
MACRO
struct A {
    int i;
};
}
Comment 4 nnnnnk 2011-01-27 12:47:04 UTC
*** Bug 159229 has been marked as a duplicate of this bug. ***
Comment 5 nnnnnk 2011-01-27 12:47:35 UTC
Example:
newfile.h:
#include "newfile1.h"
struct S {
    int i;
    int j;
};

newfile1.h:
#ifdef MACRO1
struct S {
    int i;
};
#endif

newfile.cpp:
#include "newfile.h"

int main() {
    S s; // S links to S from newfile1.h
    s.j; // unresolved j
    return 0;
}

newfile1.cpp:
#define MACRO1
#include "newfile1.h"

newfile1.h is included two times from newfile.cpp (from newfile.h) and
newfile1.cpp.
To newfile.cpp it's included without defines.
To newfile1.cpp it's included with MACRO1.
So #ifdef block in newfile1.cpp is active.
And newfile.cpp gets declaration of S from newfile1.cpp instead of newfile.cpp.

Situation is reproducible, but it depends on file parsing sequence.
Comment 6 nnnnnk 2011-01-27 12:47:38 UTC
*** Bug 151271 has been marked as a duplicate of this bug. ***
Comment 7 nnnnnk 2011-01-27 13:24:42 UTC
*** Bug 186064 has been marked as a duplicate of this bug. ***
Comment 8 Leonid Lenyashin 2012-10-30 21:09:44 UTC
There was no activity on this issue for quite a long time. We apologize that the issue was not addressed so far due to lack of development resources. We might not have time in near future to fix this problem, so it is closed as WONTFIX.
If the issue is still critical for you please do not hesitate to REOPEN it.
Thank you for using our product and reporting bugs. We are really sorry that we were not able to fix this issue timely.

Regards,
CND team.