public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Hallvard B Furuseth <h.b.furuseth@usit.uio.no> To: gcc-gnats@gcc.gnu.org Subject: c/4378: too large constant should be an error Date: Sat, 22 Sep 2001 20:06:00 -0000 [thread overview] Message-ID: <E15kzTd-0004XZ-00@bombur.uio.no> (raw) >Number: 4378 >Category: c >Synopsis: too large constant should be an error >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: accepts-illegal >Submitter-Id: net >Arrival-Date: Sat Sep 22 20:06:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Hallvard B Furuseth >Release: 3.0.1 >Organization: University of Oslo >Environment: System: SunOS bombur.uio.no 5.8 Generic_108528-03 sun4u sparc SUNW,Ultra-5_10 Architecture: sun4 host: sparc-sun-solaris2.8 build: sparc-sun-solaris2.8 target: sparc-sun-solaris2.8 configured with: ../gcc-3.0.1/configure --prefix=/usit/bombur/hbf --program-suffix=3 --enable-version-specific-runtime-libs --enable-languages=c --quiet >Description: A too large floating constant is a constraint violation of ANSI 3.1.3 (n869 6.4.4p2), but does not give an error even with -ansi -pedantic-errors. Unlike a too large integer constant, which does give error. OTOH, these do give a misleading error message with -pedantic-errors: "truncated to 64 bits". This makes it look like the compilation does not fail. In any case, I fail to see why it makes sense to _not_ make this an error. I'd think that any program which gets this warning gets compiled with incorrect data. (Maybe except overflow into the sign bit only, if that can happen. Under -traditional, maybe?) >How-To-Repeat: $ cat bug.c double d = 9e999; float f = 99999999999999999999999999999999999999999999999.9f; $ gcc -ansi -pedantic-errors -S bug.c bug.c:1: warning: floating point number exceeds range of 'double' bug.c:2: warning: floating point number exceeds range of 'float' >Fix: >Release-Note: >Audit-Trail: >Unformatted:
next reply other threads:[~2001-09-22 20:06 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-09-22 20:06 Hallvard B Furuseth [this message] 2002-04-24 15:06 rth
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=E15kzTd-0004XZ-00@bombur.uio.no \ --to=h.b.furuseth@usit.uio.no \ --cc=gcc-gnats@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: linkBe 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).