public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: John Love-Jensen <eljay@adobe.com>
To: <gcc-help@gcc.gnu.org>
Subject: pedantic Wall
Date: Fri, 18 Oct 2002 05:27:00 -0000	[thread overview]
Message-ID: <B9D567D5.5317%eljay@adobe.com> (raw)
In-Reply-To: <3CA1AFBD.4E3DE098@tdcadsl.dk>

Hi everybody,

I expect to see two warnings and/or errors for the following code:

g++ -c -pedantic -Wall foo.cpp
---foo.cpp---
enum Foo { kBar = ~0LL; };
enum Baz { kQuux = ~0L; };
---eof---

GCC 3.2 20020818 (prerelease) complains about line one "ISO C89 forbids long
long integer constants".  Complains, but does the "forbidden" thing... doing
what I asked for, regardless of ISO C89.

I was expecting to see a warning about using a long int in line two.  As per
C++PL by Stroustrup, section 4.8.

MY QUESTION...
Am I to take it that if sizeof(int) == sizeof(long), then everything is
a-okay for the long int enum values?

On the platform I'm compiling on, Cygwin for WinNT, sizeof(int) ==
sizeof(long) == 4.

Ahh, I remember back when I used SAS/C++ 6.56 (Amiga), where one could use
the language extension (more-or-less, I may have gotten the syntax jumbled)
for explicit enum storage sizes:
char enum Fred { kBarney = 'x'; };

Thanks,
--Eljay

      reply	other threads:[~2002-10-18 12:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-26 15:46 where are build instructions? rhys tucker
2002-03-27  3:41 ` bjorn rohde jensen
2002-10-18  5:27   ` John Love-Jensen [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=B9D567D5.5317%eljay@adobe.com \
    --to=eljay@adobe.com \
    --cc=gcc-help@gcc.gnu.org \
    /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).