This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
system include path warning
- To: gcc-patches at gcc dot gnu dot org
- Subject: system include path warning
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Wed, 18 Jul 2001 14:49:44 +0100
- CC: DJ Delorie <dj at redhat dot com>, Richard Henderson <rth at redhat dot com>, Zack Weinberg <zackw at Stanford dot EDU>
- Organization: Codesourcery LLC
Hi,
here's a patch which makes the duplicate system include path warning
smarter. You now do not get a warning when the duplication is provably
benign.
I'm not showing problems in checking libstdc++, but I wasn't before.
If you were affected by this, can you check that this patch DTRT?
Thanks.
Consider the include chain A, B, C, Z, B', C', Q, where B' is
marked as a system directory.
We'll want to remove B' and C', as they match B & C respectively. But,
this is only safe if Z == Q && all their systemnesses are equal (in
which case Q gets removed too). Previously we warned on this removal,
now we only warn when Z != Q or systemness is not matched. This checking
has to be done before any removal happens, as the removal can turn
an unsafe duplication into a seemingly safe duplication. For instance
if A == Z, and we did early removal, we'd see that that duplication
was ok, as B == B' && C == C' then remove Z. When we get to B, we'd
see it match B' and consider it safe as the only intermediate
directory is C, which matches C'.
I also reordered the actual removal loop, as I kept getting tripped
up by the way it scanned the list (may be that's just me though).
Yes, PREV does always have the correct value at exit from that loop.
booted & tested on i686-pc-linux-gnu, ok?
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
include.patch