[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: enum vs int and API/ABI compatibility
From: |
Simon Josefsson |
Subject: |
Re: enum vs int and API/ABI compatibility |
Date: |
Thu, 20 Oct 2011 21:57:07 +0200 |
User-agent: |
Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) |
Paul Eggert <address@hidden> writes:
> On 10/19/11 04:06, Simon Josefsson wrote:
>> 1) Is there any platform where this has any implications for the ABI?
>
> OS/400. libcurl ran into this problem; see
> <http://multitheftauto.googlecode.com/svn/trunk/vendor/curl/packages/OS400/README.OS400>.
>
> Android users are constantly worrying about whether to compile
> with -fno-short-enums, citing ABI incompatibilities. E.g., see
> <http://osdir.com/ml/android-ndk/2010-10/msg00559.html>.
>
> I expect you'll probably run into an ABI problem somewhere,
> though I couldn't find anything specifically on point to your
> coding example.
Ouch. :-(
Thanks for this information. I feared that the old assumption "enum =
int" that I have relied on wasn't really true.
It's still not clear to me that my proposed change would break on even
OS/400 though, it seems the curl problem was only about varargs? They
used a pragma to turn enum into int's, but it wasn't clear that the
compiler would pick something else if the pragma wasn't there.
/Simon