[RFC] libstdc++/6720 and libstdc++/6671

Jonathan Wakely cow@compsoc.man.ac.uk
Wed May 22 11:19:00 GMT 2002


On Wed, May 22, 2002 at 07:30:34PM +0200, Paolo Carlini wrote:

> > ext/algorithm includes <algorithm>
> > If this is changed to include "algorithm" will the preprocessor include
> > ext/algorithm from the current dir, or spot that that's the current file
> > and then proceed to look in the system dirs, finding the intended header?
> 
> Sorry, now I get your point, but this could easily be solved by including
> "../algorithm", do you agree?

Mmm, looks ok (but what do I know!)
But what if there's a later sub-dir of ext, say ext/unstable, and a file
fnord.h in there includes <algorithm>. If the user has -I${...}/ext then
ext/unstable/fnord.h would find ext/algorithm, not algorithm.
This could be solved by making fnord.h include "../../algorthim", but
then you're hardcoding the directory structure into the headers and they
could become even more fragile and vulnerable to unforeseen problems.

I still reckon it's simplest to ban -I.../ext
The only disadvantage is that users must say #include <ext/fnord> instead
of #include <fnord> and the advantage is that none of you lot have to work
out a complicated hack to make it work, that is bound to fail next time
John Q User does something unusual. Oh, and it's a documentation change
not a code change, definitely not ABI-breaking  :)


jon (hoping he's not just making unhelpful noise here)


-- 
"We're doomed!"
	- C3PO



More information about the Libstdc++ mailing list