summaryrefslogtreecommitdiffstats
path: root/arch/mips/math-emu
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2014-06-13 16:26:14 +0200
committerRalf Baechle <ralf@linux-mips.org>2014-06-16 13:47:47 +0200
commit91496ea9f86f55e87be78ecc88c8a6b7e3802601 (patch)
treec857d36e094416863850b3be21386a5f5e0beae6 /arch/mips/math-emu
parentMIPS: pm-cps: convert smp_mb__*() (diff)
downloadlinux-91496ea9f86f55e87be78ecc88c8a6b7e3802601.tar.xz
linux-91496ea9f86f55e87be78ecc88c8a6b7e3802601.zip
MIPS: math-emu: Work around limitations of older GCC.
Older GCC doesn't get named initializations of anonymous structs right, that is members are not initializable in the containing structure through name however old style initializations are working fine. The issue exists with gcc up to 4.5.x. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/math-emu')
-rw-r--r--arch/mips/math-emu/ieee754.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/arch/mips/math-emu/ieee754.c b/arch/mips/math-emu/ieee754.c
index 53f1d2287084..cb9214da372f 100644
--- a/arch/mips/math-emu/ieee754.c
+++ b/arch/mips/math-emu/ieee754.c
@@ -34,11 +34,17 @@
* Special constants
*/
+/*
+ * Older GCC requires the inner braces for initialization of union ieee754dp's
+ * anonymous struct member. Without an error will result.
+ */
#define DPCNST(s, b, m) \
{ \
- .sign = (s), \
- .bexp = (b) + DP_EBIAS, \
- .mant = (m) \
+ { \
+ .sign = (s), \
+ .bexp = (b) + DP_EBIAS, \
+ .mant = (m) \
+ } \
}
const union ieee754dp __ieee754dp_spcvals[] = {
@@ -61,11 +67,17 @@ const union ieee754dp __ieee754dp_spcvals[] = {
DPCNST(0, 63, 0x0000000000000ULL), /* + 1.0e63 */
};
+/*
+ * Older GCC requires the inner braces for initialization of union ieee754sp's
+ * anonymous struct member. Without an error will result.
+ */
#define SPCNST(s, b, m) \
{ \
+ { \
.sign = (s), \
.bexp = (b) + SP_EBIAS, \
.mant = (m) \
+ } \
}
const union ieee754sp __ieee754sp_spcvals[] = {