From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13712 invoked by alias); 29 May 2014 20:32:15 -0000 Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org Received: (qmail 13694 invoked by uid 89); 29 May 2014 20:32:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: elastic.org Received: from elastic.org (HELO elastic.org) (69.20.226.105) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 29 May 2014 20:32:13 +0000 Received: from super.elastic.org (localhost [127.0.0.1]) by elastic.org (8.14.7/8.14.7) with ESMTP id s4TKUwAq018780 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 29 May 2014 16:30:58 -0400 Received: (from fche@localhost) by super.elastic.org (8.14.7/8.14.7/Submit) id s4TKUwSM018779; Thu, 29 May 2014 16:30:58 -0400 Date: Thu, 29 May 2014 20:32:00 -0000 From: "Frank Ch. Eigler" To: Stefan Kristiansson Cc: cgen@sourceware.org, Alan Modra , fche@sourceware.org, Christian Svensson , Pierre Muller , "Maciej W. Rozycki" Subject: Re: [PATCH] Make large enum constants unsigned Message-ID: <20140529203058.GC13644@elastic.org> References: <20140522052921.GA30609@chokladfabriken.org> <20140522150956.GC4031@elastic.org> <20140522210621.GF4031@elastic.org> <20140529200819.GA9229@chokladfabriken.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20140529200819.GA9229@chokladfabriken.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-q2/txt/msg00018.txt.bz2 Hi - > [...] > Ok, that's fine by me if others are ok with it. > Below is the patch that does that. > > 2014-05-29 Stefan Kristiansson > > * enum.scm (gen-enum-decl): Emit 'U' after constants. > [...] One last piece of homework: can you identify in your patch the range of c compilers / standards-compliance-CFLAGS tested with this change? I'm a bit worried that U-suffixing may be rejected by earlier or non-gnu compilers. A little experiment shows, gcc 4.8 with -ansi -pedantic outright rejects large integers, with or without U suffix. gcc -ansi -pedantic -c foo.c foo.c:1:14: warning: ISO C restricts enumerator values to range of ‘int’ [-Wpedantic] enum i { x = 4000000000U }; It accepts with a (int)4000000000 casting formulation instead. - FChE