ARM-only [Patch] Allow 4 byte enum size (-fno-short-enums) | Remove hard coded short enum flag from the build scripts?

Corinna Vinschen vinschen@redhat.com
Tue Aug 30 09:47:00 GMT 2016


On Aug 28 16:31, Dennis Pahl wrote:
> Hi,
> 
> in my project I need the enum size to be 4 bytes. Therefore in order to get
> no linker compatibility warnings, I also require newlib to use 4 bytes for
> its enums.
> 
> 4 byte enums can be achieved by specifying the following compiler flag
> "-fno-short-enums". This flag works fine for the source code of my project.
> Newlib, however, has a problem with this flag due to some hard coded
> compiler invocations which include the opposite flag "-fshort-enums".
> 
> A look in the mailing list archive revealed, that there already has been a
> discussion about this problem
> (https://sourceware.org/ml/newlib/2013/msg00183.html). The final advice from
> Michael Bruck, who started the discussion, was to remove these hard coded
> flags entirely from the build script files. Is there a reason why this did
> not happen?
> 
> With the removed hard coded flags the enum size can be configured by
> specifying
> CFLAGS_FOR_TARGET= '-fno-short-enums' or '-fshort-enums'
> CXXFLAGS_FOR_TARGET='-fno-short-enums' or '-fshort-enums'
> 
> By following Michael Bruck's advice I was able to build newlib with the
> wanted enum size.

The patch is ok with me, what do other user's of ARM think?


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20160830/63767d87/attachment.sig>


More information about the Newlib mailing list