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: ARM-only [Patch] Allow 4 byte enum size (-fno-short-enums) | Remove hard coded short enum flag from the build scripts?


> -----Original Message-----
> From: Richard Earnshaw (lists) [mailto:Richard.Earnshaw@arm.com]
> Sent: Wednesday, August 31, 2016 1:15 PM
> To: Schwarz, Konrad (CT RDA ITP SES-DE); newlib@sourceware.org
> Subject: Re: ARM-only [Patch] Allow 4 byte enum size (-fno-short-enums)
> | Remove hard coded short enum flag from the build scripts?

> GCC/GAS/LD on ARM systems emit Build Attributes[1].  One of these
> attributes describes the way in which the file depends on how enum
> types are handled (since in an ABI it *can* affect whether the files
> are compatible with each other).  Unfortunately, GCC has a limitation
> in that it only supports two of the four possible attribute values for
> this particular attribute since we can't get at enough details in the
> mid/front end to validate the user's code complies with the attribute
> settings.

But wouldn't it suffice to allow the user to select (or override) the
build attribute to set on the file, e.g., via a compiler command line switch?

Obviously, this requires the compiler to trust the user.

Conversely, as there is no way in (standard) C to distinguish
an ABI from interfaces internal to the implementation,
any scheme to determine this build attribute automatically
cannot be fully satisfactory, no?


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