http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47741
Summary: -I- option stated obsolete considered worrying Product: gcc Version: 4.4.5 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor AssignedTo: unassig...@gcc.gnu.org ReportedBy: richard_shar...@mitel.com In gcc4.5 using the -I- option gives a warning saying it is obsolete and to use -iquote. The -iquote option does not do what we require and I am worried the option may be removed in the future. Here is our situation where the functionality provided by -I- option that is not provided by the -iquote option is required: We have a large system and have many large include directories. These are all "user" directories in the sense that they are independent of the OS vendor include directories, So all these include are "FILE" not <FILE>. A user testing changes adds a new directory to the front of the search path to ensure that this new version is included. Because with the -I- option searching is done in the listed order the new version is found. Without the -I- option the include file may or may not be changed file. The "old" version is picked up if a file in that other directory happens to include this file. What would be nice would be an option to just honour the order of the search directories. Failing that, please don't remove the -I option. Thanks. Here is a trivial example. "new" represents the code to be tested, "old" represents one of the include directories. * With the -I- the correct version of b.h is picked up * Without the -I- the wrong version is picked up. * (with -iquote the wrong version is picked up and the -E option seems to be ignored) % sh Demo.sh + ls old new new: b.h old: a.h b.h main.c + head old/main.c old/a.h old/b.h new/b.h ==> old/main.c <== #include "a.h" ==> old/a.h <== char a_msg = "this is the old a.h file"; #include "b.h" ==> old/b.h <== char b_msg "this is the original b.h with syntax error, we dont want this"; ==> new/b.h <== char b_msg = "this is the new b.h -- we want this one"; + gcc -I- -E -I new -I old old/main.c cc1: note: obsolete option -I- used, please use -iquote instead # 1 "old/main.c" # 1 "<built-in>" # 1 "<command-line>" # 1 "old/main.c" # 1 "old/a.h" 1 char a_msg = "this is the old a.h file"; # 1 "new/b.h" 1 char b_msg = "this is the new b.h -- we want this one"; # 2 "old/a.h" 2 # 1 "old/main.c" 2 + gcc -E -I new -I old old/main.c # 1 "old/main.c" # 1 "<built-in>" # 1 "<command-line>" # 1 "old/main.c" # 1 "old/a.h" 1 char a_msg = "this is the old a.h file"; # 1 "old/b.h" 1 char b_msg "this is the original b.h with syntax error, we dont want this"; # 2 "old/a.h" 2 # 1 "old/main.c" 2 + gcc -iquote -E -I new -I old old/main.c In file included from old/main.c:1: old/a.h:1: warning: initialization makes integer from pointer without a cast old/a.h:1: error: initializer element is not computable at load time In file included from old/a.h:2, from old/main.c:1: old/b.h:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before string constant %