patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-posix.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
yann@1
     1
Fixes errors
yann@1
     2
yann@1
     3
regcomp.c: In function 'parse_bracket_exp':
yann@1
     4
regcomp.c:2724: error: invalid storage class for function 'seek_collating_symbol_entry'
yann@1
     5
regcomp.c:2757: error: invalid storage class for function 'lookup_collation_sequence_value'
yann@1
     6
regcomp.c:2826: error: invalid storage class for function 'build_range_exp'
yann@1
     7
regcomp.c:2913: error: invalid storage class for function 'build_collating_symbol'
yann@1
     8
...
yann@1
     9
make[2]: *** [/home/dank/queue/jobdir.fast/crosstool-dev/build/x86_64-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.3.3/build-glibc/posix/regex.o] Error 1
yann@1
    10
yann@1
    11
See also http://sources.redhat.com/ml/glibc-cvs/2004-q3/msg01071.html
yann@1
    12
That fix requires gcc-4.0, but the fix proposed here works with older compilers, too
yann@1
    13
yann@1
    14
--- glibc-2.3.3/posix/regcomp.c.old	2005-03-16 11:40:55.000000000 -0800
yann@1
    15
+++ glibc-2.3.3/posix/regcomp.c	2005-03-16 11:50:31.000000000 -0800
yann@1
    16
@@ -2718,8 +2718,14 @@
yann@1
    17
      Seek the collating symbol entry correspondings to NAME.
yann@1
    18
      Return the index of the symbol in the SYMB_TABLE.  */
yann@1
    19
 
yann@1
    20
+#if __GNUC__ >= 4
yann@1
    21
+  auto inline int32_t
yann@1
    22
+#else
yann@1
    23
   static inline int32_t
yann@1
    24
+#endif
yann@1
    25
+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
yann@1
    26
   __attribute ((always_inline))
yann@1
    27
+#endif
yann@1
    28
   seek_collating_symbol_entry (name, name_len)
yann@1
    29
 	 const unsigned char *name;
yann@1
    30
 	 size_t name_len;
yann@1
    31
@@ -2751,8 +2757,14 @@
yann@1
    32
      Look up the collation sequence value of BR_ELEM.
yann@1
    33
      Return the value if succeeded, UINT_MAX otherwise.  */
yann@1
    34
 
yann@1
    35
+#if __GNUC__ >= 4
yann@1
    36
+  auto inline unsigned int
yann@1
    37
+#else
yann@1
    38
   static inline unsigned int
yann@1
    39
+#endif
yann@1
    40
+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
yann@1
    41
   __attribute ((always_inline))
yann@1
    42
+#endif
yann@1
    43
   lookup_collation_sequence_value (br_elem)
yann@1
    44
 	 bracket_elem_t *br_elem;
yann@1
    45
     {
yann@1
    46
@@ -2819,8 +2831,14 @@
yann@1
    47
      mbcset->range_ends, is a pointer argument sinse we may
yann@1
    48
      update it.  */
yann@1
    49
 
yann@1
    50
-  static inline reg_errcode_t
yann@1
    51
+#if __GNUC__ >= 4
yann@1
    52
+  auto inline reg_errcode_t
yann@1
    53
+#else
yann@1
    54
+  static inline reg_errcode_t
yann@1
    55
+#endif
yann@1
    56
+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
yann@1
    57
   __attribute ((always_inline))
yann@1
    58
+#endif
yann@1
    59
 # ifdef RE_ENABLE_I18N
yann@1
    60
   build_range_exp (sbcset, mbcset, range_alloc, start_elem, end_elem)
yann@1
    61
 	 re_charset_t *mbcset;
yann@1
    62
@@ -2906,8 +2924,14 @@
yann@1
    63
      COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a
yann@1
    64
      pointer argument sinse we may update it.  */
yann@1
    65
 
yann@1
    66
-  static inline reg_errcode_t
yann@1
    67
+#if __GNUC__ >= 4
yann@1
    68
+  auto inline reg_errcode_t
yann@1
    69
+#else
yann@1
    70
+  static inline reg_errcode_t
yann@1
    71
+#endif
yann@1
    72
+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
yann@1
    73
   __attribute ((always_inline))
yann@1
    74
+#endif
yann@1
    75
 # ifdef RE_ENABLE_I18N
yann@1
    76
   build_collating_symbol (sbcset, mbcset, coll_sym_alloc, name)
yann@1
    77
 	 re_charset_t *mbcset;