public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc -I- feature
@ 2005-08-31  7:29 nmake Technical Support
  2005-10-01  0:46 ` Neil Booth
  0 siblings, 1 reply; 4+ messages in thread
From: nmake Technical Support @ 2005-08-31  7:29 UTC (permalink / raw)
  To: gcc; +Cc: nmake Technical Support

This is to request reinstatement of the -I- command line directory
search option.  Sorry for the late request, we only recently became
aware that -I- is deprecated in gcc 4.0.

The Lucent(R) nmake tool (http://www.bell-labs.com/project/nmake/)
relies on -I- to implement the Lucent(R) nmake viewpathing feature
which allows developers to have copies of only the code they are
modifying in their private build area while picking up the rest of
the code from shared, common base areas.  Lucent(R) nmake viewpathing
requires the ability to override searching the directory of the
including file for #include "..." style includes.

The example below shows a development node "dev" viewpathed through
an official node "off".  The developer has a modified version of a.h
which is included from a.c in the official node.  There is also an
official version of a.h in off.  When compiling a.c from the dev
directory, the developer needs to pick up the official version of a.c
and the development version of a.h.  It is not clear how to use the
suggested replacement option -iquote to achieve the needed effect.

See http://www.bell-labs.com/project/nmake/impact/viewpath.html
and http://www.bell-labs.com/project/nmake/tutorial/s10.html for
more on Lucent(R) nmake viewpathing.  See the 2 pages linked from
http://www.bell-labs.com/project/nmake/manual/cpp.html for an
explanation of the Lucent(R) nmake cpp -I- feature.

We also read in a mailing list archive some concern that suppressing
the directory containing the current file tends to break system headers
(see http://gcc.gnu.org/ml/gcc-patches/2004-05/msg00154.html.)
We believe that a companion feature, "prefixinclude", may address
this concern by extending -I- to reasonably handle the case of
include paths with a directory prefix.

See http://www.bell-labs.com/project/nmake/manual/cppfeatures.html for
a description of prefixinclude.  gcc historically implemented -I- but
not prefixinclude, so while useful it gets us only part of the way
there.  prefixinclude support may eliminate problems encountered with
-I-.  At some point we would also like to see prefixinclude support in
gcc.
 
Other data points related to this request:

- -I- with prefixinclude has a proven, long history of use in large
   Lucent(R) nmake-based projects.

- HP aC++ and ANSI C implement -I- and prefixinclude
  http://docs.hp.com/en/5187-0137/5187-0137.html

- Sun Studio 10 implements -I-
  http://docs.sun.com/source/819-0494/sun.specific.html#60446


Let us know what you think or if you have any additional questions.
We would very much like to see -I- supported again in gcc.

Thanks.

nmake Development
Gary Selzer
Rich Brack


____________________
$ uname -a
Linux phoebe 2.6.12-1-686 #1 Tue Aug 9 13:00:08 UTC 2005 i686 GNU/Linux
$ cat /etc/debian_version
testing/unstable
$ type gcc-4.0
gcc-4.0 is /usr/bin/gcc-4.0
$ gcc-4.0 -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --enable-nls --without-included-gettext --enable-threads=posix --program-suffix=-4.0 --enable-__cxa_atexit --enable-libstdcxx-allocator=mt --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.0.2 20050806 (prerelease) (Debian 4.0.1-4)
$ pwd
/home/gms/ms/050049
$ ls -lR
.:
total 16
drwxr-xr-x  2 gms gms 4096 2005-08-23 10:23 dev
-rwxr-xr-x  1 gms gms  249 2005-08-22 17:26 mk
drwxr-xr-x  2 gms gms 4096 2005-08-22 17:30 off

./dev:
total 0
-rw-r--r--  1 gms gms 27 2005-08-22 16:28 a.h

./off:
total 4
-rw-r--r--  1 gms gms 88 2005-08-22 17:07 a.c
-rw-r--r--  1 gms gms 24 2005-08-22 16:27 a.h
$ cat off/a.c
#include <stdio.h>
#include "a.h"

int
main()
{
  printf("sval: %s version\n", sval);
}
$ cat off/a.h
#define sval "official"
$ cat dev/a.h
#define sval "development"
$ cd dev
$ gcc-4.0 -o a -iquote . ../off/a.c
$ ./a
sval: official version
$ gcc-4.0 -o a -I. -I- ../off/a.c
cc1: note: obsolete option -I- used, please use -iquote instead
$ ./a
sval: development version

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

* Re: gcc -I- feature
  2005-08-31  7:29 gcc -I- feature nmake Technical Support
@ 2005-10-01  0:46 ` Neil Booth
  2005-10-01  1:21   ` Andrew Pinski
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Booth @ 2005-10-01  0:46 UTC (permalink / raw)
  To: nmake Technical Support; +Cc: gcc

nmake Technical Support wrote:-

> This is to request reinstatement of the -I- command line directory
> search option.  Sorry for the late request, we only recently became
> aware that -I- is deprecated in gcc 4.0.

I agree this should not be removed (have been removed?).  It is now
provided by a large number of compilers and people have found good
uses for it.

I am not sure why it was slated for removal.

Neil.

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

* Re: gcc -I- feature
  2005-10-01  0:46 ` Neil Booth
@ 2005-10-01  1:21   ` Andrew Pinski
  2005-10-02  2:11     ` nmake Technical Support
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Pinski @ 2005-10-01  1:21 UTC (permalink / raw)
  To: Neil Booth; +Cc: nmake Technical Support, gcc


On Sep 30, 2005, at 8:46 PM, Neil Booth wrote:

> nmake Technical Support wrote:-
>
>> This is to request reinstatement of the -I- command line directory
>> search option.  Sorry for the late request, we only recently became
>> aware that -I- is deprecated in gcc 4.0.
>
> I agree this should not be removed (have been removed?).  It is now
> provided by a large number of compilers and people have found good
> uses for it.

I don't see why you could not use -iquote for 4.0 and above and -I -
in 3.4 and below.

-iquote=DIR -iquote=DIR2 -I a
==
-I DIR -I DIR2 -I -
but without turning off searching in the contained directory.

In fact -iquote gives better control than -I - did.


-- Pinski

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

* Re: gcc -I- feature
  2005-10-01  1:21   ` Andrew Pinski
@ 2005-10-02  2:11     ` nmake Technical Support
  0 siblings, 0 replies; 4+ messages in thread
From: nmake Technical Support @ 2005-10-02  2:11 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Neil Booth, nmake Technical Support, gcc

On Fri, Sep 30, 2005 at 09:21:01PM -0400, Andrew Pinski wrote:
> On Sep 30, 2005, at 8:46 PM, Neil Booth wrote:
> >nmake Technical Support wrote:-
> >
> >>This is to request reinstatement of the -I- command line directory
> >>search option.  Sorry for the late request, we only recently became
> >>aware that -I- is deprecated in gcc 4.0.
> >
> >I agree this should not be removed (have been removed?).  It is now
> >provided by a large number of compilers and people have found good
> >uses for it.
> 
> I don't see why you could not use -iquote for 4.0 and above and -I -
> in 3.4 and below.
> 
> -iquote=DIR -iquote=DIR2 -I a
> ==
> -I DIR -I DIR2 -I -
> but without turning off searching in the contained directory.
 
That is the problem, we need to turn off searching the directory of
the including file.  We meant to illustrate this in our original mail
but maybe it wasn't clear.  If there is another way to do that then
we may be able to use -iquote.  Otherwise we still need -I-.


Rich Brack
nmake Development

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

end of thread, other threads:[~2005-10-02  2:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-31  7:29 gcc -I- feature nmake Technical Support
2005-10-01  0:46 ` Neil Booth
2005-10-01  1:21   ` Andrew Pinski
2005-10-02  2:11     ` nmake Technical Support

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).