public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/4378: too large constant should be an error
@ 2002-04-24 15:06 rth
  0 siblings, 0 replies; 2+ messages in thread
From: rth @ 2002-04-24 15:06 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, h.b.furuseth, nobody

Synopsis: too large constant should be an error

State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Wed Apr 24 15:06:26 2002
State-Changed-Why:
    You got a diagnostic, which is all that is required by the standard.
    
    As for why 1e999 is useful, this is a common way to get
    HUGE_VAL defined as either +Inf or DBL_MAX, depending on
    whether the target supports infinities.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4378


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c/4378: too large constant should be an error
@ 2001-09-22 20:06 Hallvard B Furuseth
  0 siblings, 0 replies; 2+ messages in thread
From: Hallvard B Furuseth @ 2001-09-22 20:06 UTC (permalink / raw)
  To: gcc-gnats

>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:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-04-24 22:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-24 15:06 c/4378: too large constant should be an error rth
  -- strict thread matches above, loose matches on Subject: below --
2001-09-22 20:06 Hallvard B Furuseth

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).