[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#352859: marked as done (cpp: -iquote behaves wrong but -I- still works correct)



Your message dated Wed, 23 Jan 2008 18:19:07 +0100
with message-id <18327.30475.698069.795273@gargle.gargle.HOWL>
and subject line Bug#352859: cpp: -iquote behaves wrong but -I- still works correct
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Subject: cpp: -iquote behaves wrong but -I- still works correct
Package: cpp
Version: 4:4.0.2-2
Severity: normal

The preprocessor from gcc 4.0.x behaves wrong when using the "-iquote"
option as recommended by a warning when using "-I-".

The problem is that it doesn't honors the include directories specified
with "-iquote" within header files when a file with the same name as the
one to include resists in the same directory as the file currently being
processed.

To make this more clear imagine the following directory layout:

wolf@weinkeller:~/gcc-test$ find . -type f
./arch/foo.h
./arch/bar.h
./inc/foo.h
./inc/bar.h
./test.c
wolf@weinkeller:~/gcc-test$


The files have the following contents:

wolf@weinkeller:~/gcc-test$ cat arch/foo.h
#ifndef foo_h_arch
#define foo_h_arch
#include <bar.h>  // should include inc/bar.h
#endif
wolf@weinkeller:~/gcc-test$ cat arch/bar.h
#ifndef bar_h_arch
#define bar_h_arch
#endif
wolf@weinkeller:~/gcc-test$ cat inc/foo.h
#ifndef foo_h
#define foo_h
#include "bar.h"  // should include arch/bar.h
#endif
wolf@weinkeller:~/gcc-test$ cat inc/bar.h
#ifndef bar_h
#define bar_h
#endif
wolf@weinkeller:~/gcc-test$ cat test.c
#include <foo.h>  // does it all wrong
#include "foo.h"  // other way works ok
wolf@weinkeller:~/gcc-test$


Now the output when invoking cpp one time with the old deprecated option
-I- and after that with the recommended -iquote. I used an additional -H
to see which files get processed when:

wolf@weinkeller:~/gcc-test$ cpp -H -Iarch -I- -Iinc test.c > /dev/null
cc1: note: obsolete option -I- used, please use -iquote instead
. inc/foo.h
.. arch/bar.h
. arch/foo.h
.. inc/bar.h
wolf@weinkeller:~/gcc-test$ cpp -H -iquote arch -Iinc test.c > /dev/null
. inc/foo.h
.. inc/bar.h
. arch/foo.h
.. inc/bar.h
wolf@weinkeller:~/gcc-test$


The two commands should be equivalent but aren't. As you can see the
second run does it wrong by including inc/bar.h from within inc/foo.h
and not arch/bar.h as supposed to be. The old syntax does it right by
including arch/bar.h from inc/foo.h since the include directive is made
with quotes not brackets.
The other way (including <..>-headers) from within quoted ".."-headers
works correct for both versions.

I've created a tarball with the above mentioned files for a quick self
test. It's available at [1].

I also took a look at the bug mailing list at gcc.gnu.org but haven't
found this bug there. Maybe I'm the only one using this feature to
separate the order of header file inclusion.


I hope this information helps to get this bug fixed soon.


Yours sincerely,
Mathias Krause

[1] http://www.informatik.tu-cottbus.de/~mkrause/gcc4-iquote-bug.tar.gz

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (990, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-mk
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages cpp depends on:
ii  cpp-4.0                       4.0.2-9    The GNU C preprocessor

cpp recommends no packages.

-- no debconf information


--- End Message ---
--- Begin Message ---
tag 352859 + wontfix
thanks

closing this as wontfix (deprecated by upstream); please file an
enhancement request on the upstream bugtracker instead
(http://gcc.gnu.org/bugzilla).



--- End Message ---

Reply to: