[Bug c/57725] conflicting language extensions
joseph at codesourcery dot com
gcc-bugzilla@gcc.gnu.org
Thu Jun 27 17:04:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57725
--- Comment #8 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Thu, 27 Jun 2013, jbeulich at novell dot com wrote:
> That's why I gave the example of where this is coming from - the code obviously
> wants to be able to determine whether the data block between the two labels is
> empty. And no, using asm()-s for this sort of thing is about the last thing I'd
> consider acceptable.
But that doesn't explain why it matters whether it's empty - why you
aren't e.g. just iterating over objects between the labels (with an
iteration that happens to do nothing if it's empty) or some such operation
involving the difference between the labels (that happens to do nothing if
the difference is 0). It never matters whether __init_array_start and
__init_array_end are the same, or whether they compare equal or not, for
example, because code that uses them naturally iterates over an array
between them. I suppose such iterations use an ordered comparison with
the end pointer, and comparing whether one pointer is less than another
would work for you if you know the order the pointers would go in if
unequal (but the compiler doesn't).
It's intrinsic to using empty objects that it *doesn't matter to your
code* when odd things happen about objects at the same address. If it
matters whether addresses derived from different objects compare distinct
(including whether it's determinate whether they compare distinct), don't
use empty objects.
More information about the Gcc-bugs
mailing list