| Summary: | C++ Search doesn't find code in an #ifdef code block | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Domenic Alessi <domenico.alessi> |
| Component: | cdt-core | Assignee: | Project Inbox <cdt-core-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | Doug Schaefer <cdtdoug> |
| Severity: | normal | ||
| Priority: | P3 | CC: | lihuachen, yevshif |
| Version: | 6.0.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows Vista | ||
| Whiteboard: | |||
Indexing c/c++ source for all code branches is (currently) out of scope. We are limited to a fixed configuration. To find all occurrences of 'printf' you can use a text-search, instead. I am not lookingfor occurences of printf, in this case if I search for "void helloworld" it does not find it with the C++ search because it is ina ifdef. Basially, i won't find anything in an ifdef unless I have a define. (In reply to comment #2) > I am not lookingfor occurences of printf, in this case if I search for "void > helloworld" it does not find it with the C++ search because it is ina ifdef. > Basially, i won't find anything in an ifdef unless I have a define. Same is true for helloworld: C++ search is limited to c/c++ constructs found when parsing the source code with a fixed configuration. This excludes inactive code branches. To find occurrences beyond that you have to use the text search. Ok, thanks for the info. Please close the case, and thanks again for your time. (In reply to comment #4) > Ok, thanks for the info. Please close the case, and thanks again for your > time. I am also finding this feature in Eclipse to search in inactive code. Though text search could do this job, but it takes too much time. Could text search speedup by make index in Eclipse? Or make it as a option to enable/disable searching in inactive code. (In reply to comment #5) > (In reply to comment #4) > > Ok, thanks for the info. Please close the case, and thanks again for your > > time. > I am also finding this feature in Eclipse to search in inactive code. > Though text search could do this job, but it takes too much time. > Could text search speedup by make index in Eclipse? The text search is not maintained by the cdt project. > Or make it as a option to enable/disable searching in inactive code. We don't have the means to parse inactive code, hence we cannot offer a search. |
Build Identifier: M20100211-1343 If I search for helloworld that is in an ifdef code block it is not found, it is only found in main(). For example, if I have the following: #ifdef CDMA void helloworld (){ printf("Hello"); } #endif void main() { helloworld(); } but if I add a #define CDMA, it then finds both occurrences of helloworld. I am not sure if this is the intended design, but it would be kind of tedious to have to do this for evry ifdef for searching. Perhaps the C++ search should have a checkbox for ifdef. Reproducible: Always Steps to Reproduce: See Details