Community
Participate
Working Groups
When I rename a header (.h) file in a C project, the #includes referring to that header file are not only updated, but they are changed to relative paths, which is NOT desirable. For example, renaming foo.h to bar.h, might change #include <foo.h> to #include "../../../bar.h" Fix: Be aware of library (<...>) style header includes vs. relative path ("...") style header includes. * For library style includes, change the name only (even if the file changes directories), e.g. #include <foo.h> to #include <bar.h>. * For relative path style header includes, update the full path for moves and renames. E.g. #include "../foo.h" to #include "../../bar.h". This may be the same issue as Bug 491638, which has not been resolved for ~1.5 years.
Created attachment 271714 [details] sample project Using cdt-9.4 (Oxygen.2rc2), I also noticed that #include "foo" is changed into #include <bar> when renaming the file from foo to bar. Steps to reproduce: 1. Import attached project on Linux 2. Right-click memberdefs.h and rename to bar.h --> The #include "" style is changed to an #include <> style, which may break the code.