public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/47741] New: -I- option stated obsolete  considered worrying
@ 2011-02-14 22:54 richard_sharman at mitel dot com
  2011-02-14 22:55 ` [Bug preprocessor/47741] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: richard_sharman at mitel dot com @ 2011-02-14 22:54 UTC (permalink / raw)
  To: gcc-bugs

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: unassigned@gcc.gnu.org
        ReportedBy: richard_sharman@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
%


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug preprocessor/47741] -I- option stated obsolete  considered worrying
  2011-02-14 22:54 [Bug preprocessor/47741] New: -I- option stated obsolete considered worrying richard_sharman at mitel dot com
@ 2011-02-14 22:55 ` pinskia at gcc dot gnu.org
  2011-02-14 23:02 ` pinskia at gcc dot gnu.org
  2011-02-15 13:48 ` richard_sharman at mitel dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-02-14 22:55 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47741

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-02-14 22:54:02 UTC ---
Dup of much older bug.

*** This bug has been marked as a duplicate of bug 19541 ***


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug preprocessor/47741] -I- option stated obsolete  considered worrying
  2011-02-14 22:54 [Bug preprocessor/47741] New: -I- option stated obsolete considered worrying richard_sharman at mitel dot com
  2011-02-14 22:55 ` [Bug preprocessor/47741] " pinskia at gcc dot gnu.org
@ 2011-02-14 23:02 ` pinskia at gcc dot gnu.org
  2011-02-15 13:48 ` richard_sharman at mitel dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-02-14 23:02 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47741

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-02-14 22:55:08 UTC ---
Oh and -iquote takes an argument.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug preprocessor/47741] -I- option stated obsolete  considered worrying
  2011-02-14 22:54 [Bug preprocessor/47741] New: -I- option stated obsolete considered worrying richard_sharman at mitel dot com
  2011-02-14 22:55 ` [Bug preprocessor/47741] " pinskia at gcc dot gnu.org
  2011-02-14 23:02 ` pinskia at gcc dot gnu.org
@ 2011-02-15 13:48 ` richard_sharman at mitel dot com
  2 siblings, 0 replies; 4+ messages in thread
From: richard_sharman at mitel dot com @ 2011-02-15 13:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47741

--- Comment #3 from Richard Sharman <richard_sharman at mitel dot com> 2011-02-15 13:44:38 UTC ---
> Oh and -iquote takes an argument.
Oh thanks!  How silly of me!   Thanks for the feedback. I did try 
searching for -I- by the way but it seemed to match everything with an I 
in it!  I tried quoting "-I-" but that didn't help.

Thanks
Richard


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-15 13:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-14 22:54 [Bug preprocessor/47741] New: -I- option stated obsolete considered worrying richard_sharman at mitel dot com
2011-02-14 22:55 ` [Bug preprocessor/47741] " pinskia at gcc dot gnu.org
2011-02-14 23:02 ` pinskia at gcc dot gnu.org
2011-02-15 13:48 ` richard_sharman at mitel dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).