This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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] newlib-stdint.h: Remove 32 bit longs


On Mon, Aug 22, 2016 at 9:42 AM, Andy Ross <andrew.j.ross@intel.com> wrote:
> Andrew Pinski wrote:
>> Why do you think the above code does not have a bug in it?  int32_t
>> is long and changing it now is changing the ABI (especially for
>> C++).
>
> I don't follow.  There's no change to the ABI, the generated code is
> identical in all cases.  Can you explain what you mean?

The encoding of int and long are different in C++.  So if you have a
library built where you compiled it with the old compiler and try to
link it with the new one, the link will fail.
Again try my simple testcase and you will see that.

Thanks,
Andrew Pinski

>
> The problem here is that on 32 bit platforms (and *only* on 32 bit
> platforms), gcc picks "long" for a 32 bit type in a way that confuses
> newlib into using it for int32_t in a way that is technically legal,
> but incompatible with the way the rest of the world (including newlib
> itself when building with other compilers on the same platform!)
> works.
>
> So obvious code like I posted, which works everywhere, generates
> warnings with a newlib cross compiler.  I would like to see that
> fixed.
>
> Andy
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]