* Compiler question....
@ 2002-05-21 1:40 Ivan Gyurdiev
2002-05-21 8:29 ` Anton Altaparmakov
0 siblings, 1 reply; 3+ messages in thread
From: Ivan Gyurdiev @ 2002-05-21 1:40 UTC (permalink / raw)
To: LKML
Kernel 2.5.17
Should the compiler be blamed or the code?
gcc 2.96 compiles it. 3.1 won't.
Before people yell at me to use the recommended compiler, I would like to say
that it really wouldn't solve the problem. Compilers move forward, the code
has to comply. Therefore I'm excersing my right to ignore all warnings about
my compiler and use it. If this is a bug in the compiler, I'd agree and
switch back to 2.96. Otherwise I'd suggest the code be changed.
Comments or advice?
In file included from attrib.h:31,
from debug.h:31,
from ntfs.h:40,
from aops.c:29:
layout.h:299: unnamed fields of type other than struct or union are not
allowed
layout.h:1450: unnamed fields of type other than struct or union are not
allowed
layout.h:1466: unnamed fields of type other than struct or union are not
allowed
layout.h:1715: unnamed fields of type other than struct or union are not
allowed
layout.h:1892: unnamed fields of type other than struct or union are not
allowed
layout.h:2052: unnamed fields of type other than struct or union are not
allowed
layout.h:2064: unnamed fields of type other than struct or union are not
allowed
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Compiler question....
2002-05-21 1:40 Compiler question Ivan Gyurdiev
@ 2002-05-21 8:29 ` Anton Altaparmakov
0 siblings, 0 replies; 3+ messages in thread
From: Anton Altaparmakov @ 2002-05-21 8:29 UTC (permalink / raw)
To: ivangurdiev; +Cc: LKML
At 02:40 21/05/02, Ivan Gyurdiev wrote:
>Kernel 2.5.17
>
>Should the compiler be blamed or the code?
>gcc 2.96 compiles it. 3.1 won't.
>Before people yell at me to use the recommended compiler, I would like to say
>that it really wouldn't solve the problem. Compilers move forward, the code
>has to comply. Therefore I'm excersing my right to ignore all warnings about
>my compiler and use it. If this is a bug in the compiler, I'd agree and
>switch back to 2.96. Otherwise I'd suggest the code be changed.
>Comments or advice?
I consider it a bug in the compiler. The gcc folk have not replied to my
filed bug report yet so I have no idea if they agree or not...
The error messages the compiler is generating are completely bogus because
the unnamed fields ARE of type struct or union. It's just that they are
typedeffed so that the words "struct" and "union" do not appear. IMO that
is a screwup by gcc...
Best regards,
Anton
>In file included from attrib.h:31,
> from debug.h:31,
> from ntfs.h:40,
> from aops.c:29:
>layout.h:299: unnamed fields of type other than struct or union are not
>allowed
>layout.h:1450: unnamed fields of type other than struct or union are not
>allowed
>layout.h:1466: unnamed fields of type other than struct or union are not
>allowed
>layout.h:1715: unnamed fields of type other than struct or union are not
>allowed
>layout.h:1892: unnamed fields of type other than struct or union are not
>allowed
>layout.h:2052: unnamed fields of type other than struct or union are not
>allowed
>layout.h:2064: unnamed fields of type other than struct or union are not
>allowed
--
"I've not lost my mind. It's backed up on tape somewhere." - Unknown
--
Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
Linux NTFS Maintainer / IRC: #ntfs on irc.openprojects.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Compiler question....
@ 2002-05-21 15:49 Ed Vance
0 siblings, 0 replies; 3+ messages in thread
From: Ed Vance @ 2002-05-21 15:49 UTC (permalink / raw)
To: 'Anton Altaparmakov'; +Cc: ivangurdiev, LKML
On Tue, May 21, 2002, Anton Altaparmakov wrote:
>
> The error messages the compiler is generating are completely
> bogus because the unnamed fields ARE of type struct or union.
> It's just that they are typedeffed so that the words "struct"
> and "union" do not appear. IMO that is a screwup by gcc...
Agreed, IIRC, didn't ANSI C spec address this specific point? That any two
types which contain matching simple types must be considered to match,
regardless of how they were declared, typedef or explicitly. e.g. Unlike
Pascal, typedef does not create "new" types. It creates aggregates of simple
types.
Ed
----------------------------------------------------------------
Ed Vance edv@macrolink.com
Macrolink, Inc. 1500 N. Kellogg Dr Anaheim, CA 92807
----------------------------------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-05-21 15:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-21 1:40 Compiler question Ivan Gyurdiev
2002-05-21 8:29 ` Anton Altaparmakov
2002-05-21 15:49 Ed Vance
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®