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 216611 - Change in include directive causes wrong macro hyperlink
Summary: Change in include directive causes wrong macro hyperlink
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks: 256816
  Show dependency tree
 
Reported: 2012-08-09 14:37 UTC by Egor Ushakov
Modified: 2016-02-03 09:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
additional fix (10.06 KB, patch)
2015-11-11 14:13 UTC, Alexander Simon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Egor Ushakov 2012-08-09 14:37:42 UTC
see source code from testTwoMacros test in BasicHyperlinkTestCase.
If I open the code in the IDE and change twoMacros2.c so that it includes twoMacros2.h (not twoMacros2.h) and save the file, hyperlink on ABC from twoMacros2.h still goes to twoMacros2.c.
Comment 1 Egor Ushakov 2013-08-29 15:15:49 UTC
still valid, steps to reproduce:
create a project with 3 files:

source.cc
  #define A
  #include "1.h"

1.h
  #ifdef A
  #define XXX
  #endif

2.h
  #ifdef A
  #define XXX
  #endif

After that in 1.h hyperlink on A goes to macro definition in source.cc,
in 2.h A goes nowhere and undefined.

Now change include in source.cc to 2.h.
After that both headers are highlighted as if A is defined and in 1.h hyperlink on A still goes to source.cc and now dead code is highlighted.
Comment 2 Alexander Simon 2014-02-12 14:06:09 UTC
Fix is very risky and complicated.
Comment 3 Alexander Simon 2015-11-10 15:19:45 UTC
fixed in enum, change set:
9e3d45fe3360
Comment 4 Alexander Simon 2015-11-11 14:13:26 UTC
Created attachment 157272 [details]
additional fix
Comment 5 Quality Engineering 2015-11-12 02:33:29 UTC
Integrated into 'main-silver', will be available in build *201511120002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/911eb7bc3507
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #216611 Change in include directive causes wrong macro hyperlink
(transplanted from 9e3d45fe33607b9fff3b708bdb1e76bfccdd7c7e)
Comment 6 Alexander Simon 2015-11-17 13:56:09 UTC
fixed on enum, change set:
68de5a3328c6
Comment 7 Quality Engineering 2015-11-24 02:31:48 UTC
Integrated into 'main-silver', will be available in build *201511240002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/0891f565bcc7
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug 216611 Change in include directive causes wrong macro hyperlink
(transplanted from 68de5a3328c67a68aa77bb021f317579248ac66e)
Comment 8 soldatov 2016-02-03 09:40:17 UTC
Verified in NetBeans 8.1 patch1