public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: "Frank Ch. Eigler" <fche@elastic.org>
To: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: cgen@sourceware.org, Alan Modra <amodra@gmail.com>,
	fche@sourceware.org,        Christian Svensson <blue@cmd.nu>,
	       Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>,
	       "Maciej W. Rozycki" <macro@codesourcery.com>
Subject: Re: [PATCH] Make large enum constants unsigned
Date: Thu, 29 May 2014 20:32:00 -0000	[thread overview]
Message-ID: <20140529203058.GC13644@elastic.org> (raw)
In-Reply-To: <20140529200819.GA9229@chokladfabriken.org>

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  <stefan.kristiansson@saunalahti.fi>
> 
> 	* 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

      reply	other threads:[~2014-05-29 20:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22  5:30 Stefan Kristiansson
2014-05-22  6:22 ` Maciej W. Rozycki
2014-05-22  6:52   ` Stefan Kristiansson
2014-05-22  7:10     ` Stefan Kristiansson
2014-05-22 13:33       ` Pierre Muller
     [not found]       ` <5561926758764771034@unknownmsgid>
2014-05-22 14:10         ` Stefan Kristiansson
2014-05-22 16:14       ` Maciej W. Rozycki
2014-05-22 15:11 ` Frank Ch. Eigler
2014-05-22 17:34   ` Stefan Kristiansson
2014-05-22 21:06     ` Frank Ch. Eigler
2014-05-22 21:42       ` Maciej W. Rozycki
2014-05-22 22:20         ` Frank Ch. Eigler
2014-05-29 20:09       ` Stefan Kristiansson
2014-05-29 20:32         ` Frank Ch. Eigler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140529203058.GC13644@elastic.org \
    --to=fche@elastic.org \
    --cc=amodra@gmail.com \
    --cc=blue@cmd.nu \
    --cc=cgen@sourceware.org \
    --cc=fche@sourceware.org \
    --cc=macro@codesourcery.com \
    --cc=pierre.muller@ics-cnrs.unistra.fr \
    --cc=stefan.kristiansson@saunalahti.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).