linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mips: math-emu: Fix compilation error ieee754.c
@ 2014-06-11  9:24 Eunbong Song
  2014-06-11 17:10 ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: Eunbong Song @ 2014-06-11  9:24 UTC (permalink / raw)
  To: ralf; +Cc: linux-kernel, linux-mips

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=euc-kr, Size: 1316 bytes --]


ieee754dp has bitfield member in struct without name. And this
cause compilation error. This patch removes struct in ieee754dp
declaration. So compilation error is fixed.
Signed-off-by: Eunbong Song <eunb.song@samsung.com>
---
 arch/mips/math-emu/ieee754.h |   20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/arch/mips/math-emu/ieee754.h b/arch/mips/math-emu/ieee754.h
index 43c4fb5..c6e28b8 100644
--- a/arch/mips/math-emu/ieee754.h
+++ b/arch/mips/math-emu/ieee754.h
@@ -32,22 +32,18 @@
 #include <asm/bitfield.h>
 
 union ieee754dp {
- struct {
-  __BITFIELD_FIELD(unsigned int sign:1,
-  __BITFIELD_FIELD(unsigned int bexp:11,
-  __BITFIELD_FIELD(u64 mant:52,
-  ;)))
- };
+ __BITFIELD_FIELD(unsigned int sign:1,
+ __BITFIELD_FIELD(unsigned int bexp:11,
+ __BITFIELD_FIELD(u64 mant:52,
+ ;)))
  u64 bits;
 };
 
 union ieee754sp {
- struct {
-  __BITFIELD_FIELD(unsigned sign:1,
-  __BITFIELD_FIELD(unsigned bexp:8,
-  __BITFIELD_FIELD(unsigned mant:23,
-  ;)))
- };
+ __BITFIELD_FIELD(unsigned sign:1,
+ __BITFIELD_FIELD(unsigned bexp:8,
+ __BITFIELD_FIELD(unsigned mant:23,
+ ;)))
  u32 bits;
 };
 
-- 
1.7.0.1ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: mips: math-emu: Fix compilation error ieee754.c
  2014-06-11  9:24 mips: math-emu: Fix compilation error ieee754.c Eunbong Song
@ 2014-06-11 17:10 ` Ralf Baechle
  2014-06-11 21:32   ` David Rientjes
  0 siblings, 1 reply; 4+ messages in thread
From: Ralf Baechle @ 2014-06-11 17:10 UTC (permalink / raw)
  To: Eunbong Song; +Cc: linux-kernel, linux-mips

On Wed, Jun 11, 2014 at 09:24:51AM +0000, Eunbong Song wrote:

> ieee754dp has bitfield member in struct without name. And this
> cause compilation error. This patch removes struct in ieee754dp
> declaration. So compilation error is fixed.
> Signed-off-by: Eunbong Song <eunb.song@samsung.com>

What gcc version are you using?

  Ralf

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: mips: math-emu: Fix compilation error ieee754.c
  2014-06-11 17:10 ` Ralf Baechle
@ 2014-06-11 21:32   ` David Rientjes
  2014-06-23 23:50     ` GCC version requirement (was: Re: mips: math-emu: Fix compilation error ieee754.c) Maciej W. Rozycki
  0 siblings, 1 reply; 4+ messages in thread
From: David Rientjes @ 2014-06-11 21:32 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Eunbong Song, linux-kernel, linux-mips

On Wed, 11 Jun 2014, Ralf Baechle wrote:

> On Wed, Jun 11, 2014 at 09:24:51AM +0000, Eunbong Song wrote:
> 
> > ieee754dp has bitfield member in struct without name. And this
> > cause compilation error. This patch removes struct in ieee754dp
> > declaration. So compilation error is fixed.
> > Signed-off-by: Eunbong Song <eunb.song@samsung.com>
> 
> What gcc version are you using?
> 

make arch/mips/math-emu/ieee754.o for mips defconfig triggers the 
following on linux-next 30 times:

arch/mips/math-emu/ieee754.c:45:2: error: unknown field 'sign' specified in initializer
arch/mips/math-emu/ieee754.c:45:2: warning: missing braces around initializer
arch/mips/math-emu/ieee754.c:45:2: warning: (near initialization for '__ieee754dp_spcvals[0].<anonymous>')
arch/mips/math-emu/ieee754.c:45:2: error: unknown field 'bexp' specified in initializer
arch/mips/math-emu/ieee754.c:45:2: warning: excess elements in union initializer
arch/mips/math-emu/ieee754.c:45:2: warning: (near initialization for '__ieee754dp_spcvals[0]')
arch/mips/math-emu/ieee754.c:45:2: error: unknown field 'mant' specified in initializer
arch/mips/math-emu/ieee754.c:45:2: warning: excess elements in union initializer
arch/mips/math-emu/ieee754.c:45:2: warning: (near initialization for '__ieee754dp_spcvals[0]')

I'm using gcc 4.5.1 for mips.  The patch makes all members part of the 
union so it's probably not what you want to fix it, though.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* GCC version requirement (was: Re: mips: math-emu: Fix compilation error ieee754.c)
  2014-06-11 21:32   ` David Rientjes
@ 2014-06-23 23:50     ` Maciej W. Rozycki
  0 siblings, 0 replies; 4+ messages in thread
From: Maciej W. Rozycki @ 2014-06-23 23:50 UTC (permalink / raw)
  To: David Rientjes
  Cc: Al Viro, Ralf Baechle, Eunbong Song, linux-kernel, linux-mips

On Wed, 11 Jun 2014, David Rientjes wrote:

> > > ieee754dp has bitfield member in struct without name. And this
> > > cause compilation error. This patch removes struct in ieee754dp
> > > declaration. So compilation error is fixed.
> > > Signed-off-by: Eunbong Song <eunb.song@samsung.com>
> > 
> > What gcc version are you using?
> > 
> 
> make arch/mips/math-emu/ieee754.o for mips defconfig triggers the 
> following on linux-next 30 times:
> 
> arch/mips/math-emu/ieee754.c:45:2: error: unknown field 'sign' specified in initializer
> arch/mips/math-emu/ieee754.c:45:2: warning: missing braces around initializer
> arch/mips/math-emu/ieee754.c:45:2: warning: (near initialization for '__ieee754dp_spcvals[0].<anonymous>')
> arch/mips/math-emu/ieee754.c:45:2: error: unknown field 'bexp' specified in initializer
> arch/mips/math-emu/ieee754.c:45:2: warning: excess elements in union initializer
> arch/mips/math-emu/ieee754.c:45:2: warning: (near initialization for '__ieee754dp_spcvals[0]')
> arch/mips/math-emu/ieee754.c:45:2: error: unknown field 'mant' specified in initializer
> arch/mips/math-emu/ieee754.c:45:2: warning: excess elements in union initializer
> arch/mips/math-emu/ieee754.c:45:2: warning: (near initialization for '__ieee754dp_spcvals[0]')
> 
> I'm using gcc 4.5.1 for mips.  The patch makes all members part of the 
> union so it's probably not what you want to fix it, though.

 There's more recent breakage like this, e.g.:

mm/page_io.c: In function '__swap_writepage':
mm/page_io.c:277: error: unknown field 'bvec' specified in initializer
mm/page_io.c:278: warning: excess elements in struct initializer
mm/page_io.c:278: warning: (near initialization for 'from')

introduced with "bio_vec-backed iov_iter" (GCC 4.1.2 here).  We still in 
principle support GCC versions back to 3.2:

$ grep 'Gnu C' Documentation/Changes
o  Gnu C                  3.2                     # gcc --version
$ 

so either this breakage has to be cleaned up or the requirement for the 
minimum GCC version revisited.

 This is a semi-standard language extension BTW, citing from the GCC 
manual:

--------------------------------------------------------------------------
6 Extensions to the C Language Family
*************************************

GNU C provides several language features not found in ISO standard C.
(The `-pedantic' option directs GCC to print a warning message if any
of these features is used.)  To test for the availability of these
features in conditional compilation, check for a predefined macro
`__GNUC__', which is always defined under GCC.

6.59 Unnamed struct/union fields within structs/unions
======================================================

As permitted by ISO C11 and for compatibility with other compilers, GCC
allows you to define a structure or union that contains, as fields,
structures and unions without names.
--------------------------------------------------------------------------

-- note the term "permitted" rather than "required".

 We do make use of a few GCC language extensions, most notably inline 
assembly, however in this case we merely save a couple of characters here 
and there and this is IMO not worth breaking people's development 
environments.

  Maciej

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-06-23 23:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-11  9:24 mips: math-emu: Fix compilation error ieee754.c Eunbong Song
2014-06-11 17:10 ` Ralf Baechle
2014-06-11 21:32   ` David Rientjes
2014-06-23 23:50     ` GCC version requirement (was: Re: mips: math-emu: Fix compilation error ieee754.c) Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).