This is the mail archive of the
mailing list for the GCC project.
is this GNAT error message confusing or am I confused or both?
- From: Georg Bauhaus <bauhaus at futureapps dot de>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 07 Jan 2005 02:32:02 +0100
- Subject: is this GNAT error message confusing or am I confused or both?
- Organization: Home
The following error message has four occurences in
the GNAT sources. It has puzzled me several times.
I think it is really hard to understand because of
its "referential structure",
This is an example message printed by GNAT:
zx.adb:10:07: invalid prefix in selected component "X"
Maybe I'm just not familiar enough with the compiler writers'
point of view (or with Enlish language). A first question is,
what does "in" refer to? My current interpretation of the
message is that X is a prefix, then there is a thing termed
"component" and X is used as a prefix to the thing.
(Have you thought otherwise? :-)
Is that really a "prefix in", not a "prefix to"?
When I first saw this message I was mislead, I think.
I was wondering where there was a prefix in component "X",
i.e., (in (component X)), not ((in component) X) or
(in component): and the invalid prefix is: "X".
I was asking myself, is there a prefix of the
name "X", not of some "Z.X", that denotes a component?
And what is invalid about it (the X, not the Z)?
This is the example from which the above message is produced.
procedure zx is
package Z is
subtype X is Natural;
if X.Y /= 0 then
x in attr "B"
is parenthesized as
x in (attr "B")
which is not the way to read the above error message,
because "selected component" is not an attribute of "X",
I think. Is this right? Should the message text be changed
Consider the message,
invalid bucket in selected water "HasHoles" ;-)