patches/gcc/4.0.1/120-pr21951-fix2.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Apr 26 21:31:05 2008 +0000 (2008-04-26)
changeset 454 372b2f397baa
permissions -rw-r--r--
Configure tsocks with a simple heuristic.

Consider the proxy has to be in a 'local' network. It means it is directly
reachable by the local machine, even if the local machine has to hop through
one or more gates to reach the proxy (often the case in enterprise networks
where class A 10.0.0.0/8 is in fact sub-divided into smaller networks, each
one of them in a different location, eg. 10.1.0.0/16 in a place, while
10.2.0.0/16 would be on the other side of the world). Not being in the same
subnet does not mean the proxy is not available.

So we will build a mask with at most high bits set, which defines a network
that has both the local machine and the proxy. Because a machine may have
more than one interface, build a mask for each of them, removing 127.0.0.1
which is added automagically by tsocks, and removing duplicate masks.

If all of this does not work, then it means the local machine can NOT in fact
reach the proxy, which in turn means the user mis-configured something (most
probably a typo...).

/trunk/scripts/crosstool.sh | 61 52 9 0 +++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 52 insertions(+), 9 deletions(-)
     1 Workaround for buglet in std::vector etc. when compiling
     2 with gcc-4.0.1 -Wall -O -fno-exceptions
     3 Fixes:
     4 
     5 .../include/c++/4.0.0/bits/vector.tcc: In member function 'void std::vector<_Tp,
     6 _Alloc>::reserve(size_t) [with _Tp = int, _Alloc = std::allocator<int>]':
     7 .../include/c++/4.0.0/bits/vector.tcc:78: warning: control may reach end of
     8 non-void function 'typename _Alloc::pointer std::vector<_Tp,
     9 _Alloc>::_M_allocate_and_copy(size_t, _ForwardIterator, _ForwardIterator) [with
    10 _ForwardIterator = int*, _Tp = int, _Alloc = std::allocator<int>]' being inlined
    11 
    12 See http://gcc.gnu.org/PR21951
    13 
    14 To: gcc-patches at gcc dot gnu dot org
    15 Subject: [4.0.x] may reach end warning in system headers
    16 Message-Id: <20050701183024.E138714C16A9@geoffk5.apple.com>
    17 Date: Fri,  1 Jul 2005 11:30:24 -0700 (PDT)
    18 From: gkeating at apple dot com (Geoffrey Keating)
    19 
    20 
    21 One of our users was getting
    22 
    23 /usr/include/gcc/darwin/4.0/c++/bits/stl_uninitialized.h:113: warning:
    24 control may reach end of non-void function '_ForwardIterator
    25 std::__uninitialized_copy_aux(_InputIterator, _InputIterator,
    26 _ForwardIterator, __false_type) [with _InputIterator =
    27 __gnu_cxx::__normal_iterator<TPoolAllocator::tAllocState*,
    28 std::vector<TPoolAllocator::tAllocState,
    29 std::allocator<TPoolAllocator::tAllocState> > >, _ForwardIterator =
    30 __gnu_cxx::__normal_iterator<TPoolAllocator::tAllocState*,
    31 std::vector<TPoolAllocator::tAllocState,
    32 std::allocator<TPoolAllocator::tAllocState> > >]' being inlined
    33 
    34 which shouldn't be happening, he has no way to change a standard C++
    35 header.  The warning is bogus anyway, but it's fixed in 4.1 through
    36 the CFG changes, which I don't really want to backport to the 4.0
    37 branch, so instead I'll add this patch.  Other warnings generated from
    38 tree-inline.c check for DECL_SYSTEM_HEADER like this.
    39 
    40 Bootstrapped & tested on powerpc-darwin8, I'll commit when the branch
    41 is unfrozen.
    42 
    43 -- 
    44 - Geoffrey Keating <geoffk@apple.com>
    45 
    46 ===File ~/patches/gcc-40-4121982.patch======================
    47 Index: ChangeLog
    48 2005-06-28  Geoffrey Keating  <geoffk@apple.com>
    49 
    50 	* tree-inline.c (expand_call_inline): Prevent 'may reach end'
    51 	warning in system headers.
    52 
    53 Index: tree-inline.c
    54 ===================================================================
    55 RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
    56 retrieving revision 1.170.8.4
    57 diff -u -p -u -p -r1.170.8.4 tree-inline.c
    58 --- gcc-4.0.1/gcc/tree-inline.c.old	6 Jun 2005 19:20:32 -0000	1.170.8.4
    59 +++ gcc-4.0.1/gcc/tree-inline.c	1 Jul 2005 18:27:26 -0000
    60 @@ -1693,7 +1693,8 @@ expand_call_inline (tree *tp, int *walk_
    61  	&& !TREE_NO_WARNING (fn)
    62  	&& !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (fn)))
    63  	&& return_slot_addr == NULL_TREE
    64 -	&& block_may_fallthru (copy))
    65 +	&& block_may_fallthru (copy)
    66 +	&& !DECL_IN_SYSTEM_HEADER (fn))
    67        {
    68  	warning ("control may reach end of non-void function %qD being inlined",
    69  		 fn);
    70 ============================================================
    71