erik quanstrom wrote:
assuming that pointers to incomplete types are
themselves incomplete, and you haven't cited
chapter and verse showing they are, i read that paragraph
as saying that what plan 9 libraries do would be
illegal, and therefore if we follow the standard,
we'd need to remove
On Tue, 14 Jul 2009 12:45:56 -0700
Russ Cox r...@swtch.com wrote:
enough.
there was a bug, plain and simple.
struct T {
struct S s;
};
is not valid. never was, never will be.
fix the compiler already.
Newbie question: Does this statement apply to any struct S (meaning you can
Newbie question: Does this statement apply to any struct S (meaning you can
never have a struct as member of another struct), or does it only apply in
cases where the structure of S is not known at that point?
the latter.
- erik
erik quanstrom wrote:
Yes, but in my example - sorry - NeverDefined doesn't mean declared and
defined elsewhere (or not) but not declared .and. not defined.
true enough. the patch i sent still rejects your construct.
i'd still be interested to hear a perspective of someone with
more
The point is how to compute the offset(s) of the last field at compile /
run time.
the offset of the last field is not in question. i believe you mean the size?
8c should reject not defined (named only) types, as *nix compilers do.
yes.
I prefer to have only the tricky but standard
erik quanstrom wrote:
The point is how to compute the offset(s) of the last field at compile /
run time.
the offset of the last field is not in question. i believe you mean the size?
It's really the same info.
struct
{
. // total sizeof = 100
int B[..];
}A;
erik quanstrom wrote:
The point is how to compute the offset(s) of the last field at compile /
run time.
the offset of the last field is not in question. i believe you mean the
size?
It's really the same info.
it is not. the size and offset are different things.
On Mon, 2009-07-13 at 23:14 -0400, erik quanstrom wrote:
Yes, but in my example - sorry - NeverDefined doesn't mean declared and
defined elsewhere (or not) but not declared .and. not defined.
true enough. the patch i sent still rejects your construct.
i'd still be interested to hear a
rejecting the struct seems like the right thing to do as per
ISO/IEC 9899:1999 (http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf)
sec. 6.7.2.1 para. 2
A structure or union shall not contain a member with incomplete or function
type (hence,
a structure shall not contain an
On Tue, 2009-07-14 at 13:46 -0400, erik quanstrom wrote:
rejecting the struct seems like the right thing to do as per
ISO/IEC 9899:1999
(http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf)
sec. 6.7.2.1 para. 2
A structure or union shall not contain a member with incomplete or
For the dirty corner of any language one is usually better off with
a written formal standard. Now, since Plan9 doesn't have such a
document, relying on a work done by c99 committee would seem like
a wise thing to do.
And it is not like we are talking about C++ ISO standard here, the
C99
enough.
there was a bug, plain and simple.
struct T {
struct S s;
};
is not valid. never was, never will be.
fix the compiler already.
russ
erik quanstrom wrote:
8c silently accept the above definition and sizeof(U) is 100. ???
The sources which include the definition of NeverDefined are
regularly compiled too and sizeof(U) = 100 + sizeof(NeverDefined).
i think the issue is that there isn't currently a distinction
between
Yes, but in my example - sorry - NeverDefined doesn't mean declared and
defined elsewhere (or not) but not declared .and. not defined.
true enough. the patch i sent still rejects your construct.
i'd still be interested to hear a perspective of someone with
more experience with the c compiler.
Yes, but in my example - sorry - NeverDefined doesn't mean declared and
defined elsewhere (or not) but not declared .and. not defined.
no and yes.
union U
{
struct
{
struct NeverDefined nf; // Unknown, definition
not #included
} S1
};
declares a struct named
8c silently accept the above definition and sizeof(U) is 100. ???
The sources which include the definition of NeverDefined are
regularly compiled too and sizeof(U) = 100 + sizeof(NeverDefined).
i think the issue is that there isn't currently a distinction
between this
typedef
Hi, all.
Yesterday I observed different sizeof() of a union in a library function
and in the main program. The reason seems to be a forgotten #include
in a library source.
union U
{
struct
{
fields of defined types// sizeof = 100
struct NeverDefined nf;
17 matches
Mail list logo