This is the mail archive of the
mailing list for the GCC project.
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 15 Jan 2012 19:06:02 +0100 (CET)
- Subject: comp_type_attributes
- Reply-to: gcc at gcc dot gnu dot org
I am trying to understand comp_type_attributes, which checks whether
attributes are compatible. From what I understand, on many platforms, that
function can only ever return 1. Indeed, it does some checks to know
whether it can answer 1, and if not it forwards to the target, which by
default just returns 1. It looks like it could directly forward to the
target. Which would leave the pretty printer as the only user of the
affects_type_identity property of an attribute...
Now the reason I looked at this is because I was expecting a different
behavior. I added a new (function type) attribute in a front-end and
specified that it affects type identity. When comp_type_attributes sees
this attribute in one type but not the other, it can't answer yes, so it
forwards to the target. The target just answers yes by default (some check
for their own attributes, but they ignore the rest).
Is that what's supposed to happen? I can use another mechanism than
attributes, but this looks suspicious.