This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] fix compilation error in libbid
- From: Bernhard Fischer <rep dot dot dot nop at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: hjl at lucon dot org
- Date: Mon, 19 Nov 2007 16:48:15 +0100
- Subject: Re: [PATCH] fix compilation error in libbid
- References: <20071119154038.GA451@aon.at>
On Mon, Nov 19, 2007 at 04:40:38PM +0100, Bernhard Fischer wrote:
>Hi,
>
>I was getting errors due to conflicting types for __bid_convert_table et
>al ¹). Looks like it was missing a const.
>
>Untested. Hjl, please fix.
>
>Thanks,
>
>libgcc/ChangeLog:
>
>2007-11-19 Bernhard Fischer <aldot>
>
> * config/libbid/bid64_div.c: Also extern decl of
> __bid_{convert_table,factors,packed_10000_zeros} have to be const.
* config/libbid/bid128_div.c: Likewise.
Sorry, the 128 needs this, too.
Updated patch attached.
libgcc/ChangeLog:
2007-11-19 Bernhard Fischer <aldot>
* config/libbid/bid64_div.c: Also extern decl of
__bid_{convert_table,factors,packed_10000_zeros} have to be const.
* libgcc/config/libbid/bid128_div.c: Likewise.
Index: gcc-4.3/libgcc/config/libbid/bid64_div.c
===================================================================
--- gcc-4.3/libgcc/config/libbid/bid64_div.c (revision 130291)
+++ gcc-4.3/libgcc/config/libbid/bid64_div.c (working copy)
@@ -66,9 +66,9 @@
#define FE_ALL_FLAGS FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW|FE_UNDERFLOW|FE_INEXACT
#endif
-extern UINT32 convert_table[5][128][2];
-extern SINT8 factors[][2];
-extern UINT8 packed_10000_zeros[];
+extern const UINT32 convert_table[5][128][2];
+extern const SINT8 factors[][2];
+extern const UINT8 packed_10000_zeros[];
#if DECIMAL_CALL_BY_REFERENCE
@@ -1366,11 +1366,6 @@
//#define LEAVE_TRAILING_ZEROS
-extern UINT32 convert_table[5][128][2];
-extern SINT8 factors[][2];
-extern UINT8 packed_10000_zeros[];
-
-
//UINT64* bid64_div128x128(UINT64 res, UINT128 *px, UINT128 *py, unsigned rnd_mode, unsigned *pfpsf)
TYPE0_FUNCTION_ARG128_ARG128 (UINT64, bid64qq_div, x, y)
Index: gcc-4.3/libgcc/config/libbid/bid128_div.c
===================================================================
--- gcc-4.3/libgcc/config/libbid/bid128_div.c (revision 130291)
+++ gcc-4.3/libgcc/config/libbid/bid128_div.c (working copy)
@@ -34,9 +34,9 @@
#define FE_ALL_FLAGS FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW|FE_UNDERFLOW|FE_INEXACT
#endif
-extern UINT32 convert_table[5][128][2];
-extern SINT8 factors[][2];
-extern UINT8 packed_10000_zeros[];
+extern const UINT32 convert_table[5][128][2];
+extern const SINT8 factors[][2];
+extern const UINT8 packed_10000_zeros[];
BID128_FUNCTION_ARG2 (bid128_div, x, y)