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


On Thu, Apr 16, 2009 at 6:23 PM, Ian Lance Taylor <iant@google.com> wrote:
> 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.

It should be documented explcitly that way then.  And possibly a
warning should be emitted in these cases.

Of course I still don't like this extension too much (so I'd like to constrain
it as much as possible).

Richard.

> 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]