Bug 551533 - Provider (CDT GCC Built-in Compiler Settings) breaks indexer by messing up include order
Summary: Provider (CDT GCC Built-in Compiler Settings) breaks indexer by messing up in...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build (show other bugs)
Version: Next   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-build-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-26 13:51 EDT by Wolfgang Pupp CLA
Modified: 2019-09-26 13:53 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Pupp CLA 2019-09-26 13:51:19 EDT
Include path search order is generally not preserved by the provider (CDT GCC Built-in Compiler Settings).

This breaks the Indexer whenever the search order matters.

Example (2 custom include paths added, "tmp" and "chip-1"):

${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}" -Itmp -Ichip-1

=> output from gcc, with include path order still clearly preserved:

#define __declspec(x) __attribute__((x))
#define __DECIMAL_BID_FORMAT__ 1
#define _REENTRANT 1
 tmp
 chip-1
 C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../include/c++/9.2.0
 C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../include/c++/9.2.0/x86_64-w64-mingw32
 C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../include/c++/9.2.0/backward
 C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/include
 C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../include
 C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/include-fixed
 C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/include
End of search list.

=> Resulting include path order in eclipse:

[...]/mingw64/include
[...]/mingw64/include/c++/9.2.0
[...]/mingw64/include/c++/9.2.0/backward
[...]/mingw64/include/c++/9.2.0/x86_64-w64-mingw32
[...]/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.0/include
[...]/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.0/include-fixed
[...]/mingw64/x86_64-w64-mingw32/include
[...]/chip-1
[...]/tmp

Note how the order of the two custom includes was flipped!