From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53721 invoked by alias); 30 Aug 2016 12:45:24 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 53696 invoked by uid 89); 30 Aug 2016 12:45:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:1710, sk:vinsche, U*vinschen, Hx-spam-relays-external:8.3.389.2 X-HELO: OARmail.OARCORP.com Received: from oarmail.oarcorp.com (HELO OARmail.OARCORP.com) (67.63.146.244) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 Aug 2016 12:45:19 +0000 Received: from [192.168.0.8] (207.98.215.166) by OARmail.OARCORP.com (192.168.2.2) with Microsoft SMTP Server (TLS) id 8.3.389.2; Tue, 30 Aug 2016 07:45:17 -0500 User-Agent: K-9 Mail for Android In-Reply-To: <20160830094718.GB23664@calimero.vinschen.de> References: <86388ac2-70e3-2a15-a021-cab3b0dea9fe@pahl.de> <20160830094718.GB23664@calimero.vinschen.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="UTF-8" Subject: Re: ARM-only [Patch] Allow 4 byte enum size (-fno-short-enums) | Remove hard coded short enum flag from the build scripts? From: Joel Sherrill Date: Tue, 30 Aug 2016 12:45:00 -0000 To: "newlib@sourceware.org" ,Corinna Vinschen ,Dennis Pahl CC: "d.pahl@pilz.de" ,Matthew Wahab Message-ID: <1105B661-66D6-4525-9304-4F9907DE40CA@oarcorp.com> X-SW-Source: 2016/txt/msg01031.txt.bz2 On August 30, 2016 4:47:18 AM CDT, Corinna Vinschen wrote: >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? I assume the default is 32 bit. Does configuring newlib for small size automatically trigger the small enum size? Someone who works more intimately with the arm and especially the smaller ones needs to comment --joel > >Corinna --joel