Skip to content

Commit 91496ea

Browse files
committed
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>
1 parent 7c5491b commit 91496ea

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

‎arch/mips/math-emu/ieee754.c‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,17 @@
3434
* Special constants
3535
*/
3636

37+
/*
38+
* Older GCC requires the inner braces for initialization of union ieee754dp's
39+
* anonymous struct member. Without an error will result.
40+
*/
3741
#define DPCNST(s, b, m) \
3842
{ \
39-
.sign = (s), \
40-
.bexp = (b) + DP_EBIAS, \
41-
.mant = (m) \
43+
{ \
44+
.sign = (s), \
45+
.bexp = (b) + DP_EBIAS, \
46+
.mant = (m) \
47+
} \
4248
}
4349

4450
const union ieee754dp __ieee754dp_spcvals[] = {
@@ -61,11 +67,17 @@ const union ieee754dp __ieee754dp_spcvals[] = {
6167
DPCNST(0, 63, 0x0000000000000ULL), /* + 1.0e63 */
6268
};
6369

70+
/*
71+
* Older GCC requires the inner braces for initialization of union ieee754sp's
72+
* anonymous struct member. Without an error will result.
73+
*/
6474
#define SPCNST(s, b, m) \
6575
{ \
76+
{ \
6677
.sign = (s), \
6778
.bexp = (b) + SP_EBIAS, \
6879
.mant = (m) \
80+
} \
6981
}
7082

7183
const union ieee754sp __ieee754sp_spcvals[] = {

0 commit comments

Comments
 (0)