This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: cannot bind packed field error
- From: John Love-Jensen <eljay at adobe dot com>
- To: Christoph Bartoschek <gcc at pontohonk dot de>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Tue, 02 May 2006 10:28:07 -0500
- Subject: Re: cannot bind packed field error
Hi Christoph,
> Is this an error in the compiler or is there a mistake in the code?
I think (but I'm not sure) that it is a mistake in the code.
In that the alignment and packing constraints of a.b.c are different from a
plain old int& and int const&.
On some platforms, it may be that they happen to be compatible. But on
other platforms, maybe not.
By "platform" I mean the hardware architecture + OS (and particular version)
+ compile (including the particular compiler version).
> I expect, that if the compiler really is not able to bind the value to an
> int&, then it tries to bind the value to int const & as this is done with
> temporaries for example.
It won't create a temporary. But if you want it to, you can do this:
func(a.b.c + 0);
HTH,
--Eljay