This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH RFA: Support Plan 9 extensions in gcc


Richard Guenther <richard.guenther@gmail.com> writes:

>>> Some more constructive concerns. ÂWhat happens with
>>>
>>> struct s2 { int b; struct s1; struct { struct s1; int c; }; };
>>> void f2 (struct s2 *p) { f1 (p); }
>>> ?
>>
>> You get the first one.
>
> I would like to see an error here at least.  This kind of ambiguities
> are not good to accept without diagnostics.

My understanding is that that case is not intended to be an error in the
Plan 9 compiler.  The ambiguity is intended to be resolved by selecting
the field at the lowest depth.

I think that this case:
  struct s2 { struct s1; struct s1; };
is intended to be an error.

I think that this case:
  struct s1 { int i; };
  struct s2 { struct s1; };
  struct s3 { struct s2; struct s2; };
is intended to be accepted, but writing
  int f (struct s1 *p) { return p.i; }
is intended to be an error because there are two different fields named
'i' at the same depth.

I'll verify with the Plan 9 compiler and update the patch.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]