Bug #10624 2007-03-13 23:54

sstienen

gcc: faulty/deprecated/ default options

g++ options include -I-, as already noted in:

https://developer.berlios.de/bugs/?func=detailbug&bug_id=6908&group_id=5358

Short summary of original post:

----

-I- breaks include habits of gcc for source files residing in sub directories (example taken from OP)

#include <foo/bar.h>

... and in bar.h:

#include "moo/moo.h"

bah.h tries to include "./moo/moo.h" instead of <foo/moo/moo.h>

----

It was claimed to be fixed by an option to add the current files path to the list of include directories, however:

a) The characteristics of the "fix" are different: Instead of searching in the current files directory *first*, it is searched *last*! The include directive has to be in the first one.

b) Even if it is the first one, this helps only for direct includes. It wouldn't even fix the given example, because it would add the current files directory to the include path list. The needed directory would be the one referred to by <foo>, though.

On top of that, -I- is deprecated since at least GCC 4.1, so *PLEASE* add an option to remove it - I additionally noticed that "." is always added as an include directory as well - how about a text box in the Advanced compiler options "Others" page which holds the "default include directives"?

-I. could also be moved to Search directories > Compiler

Since its positionon the bug list didn't change, I don't know whether my note on the original bug report will raise some sort so flag so it will be reviewed, that's why I also filed a new bug report on it. If the note on the other bug *will* be reviewed, please disregard one of them.

Category
Compiler
Group
 
Status
Closed
Close date
2007-12-17 14:15
Assigned to
mortenmacfly
biplab 2007-03-14 08:47

Will look into it.

biplab 2007-07-15 12:31

Now deprecated option '-I-' wouldn't be used for the GCC 4.x series. The changes are in rev 4266.

Still part (a) of this bug-report is unresolved.

mortenmacfly 2007-12-17 14:15

Duplicate of Bug #7796