public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/47830] New: errors in intrinsics/c99_functions.c
@ 2011-02-21 8:26 kuehro at gmx dot de
2011-02-21 9:45 ` [Bug libfortran/47830] " burnus at gcc dot gnu.org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: kuehro at gmx dot de @ 2011-02-21 8:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47830
Summary: errors in intrinsics/c99_functions.c
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libfortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: kuehro@gmx.de
Since 2007-08 roundl() has a version for systems that lack ceill but
have nextafterl. This is the case on NetBSD know. There are two
errors making it non-compileable. Line numbers are different
depending on gcc version, so please change
static long double prechalf = nexafterl (0.5L, LDBL_MAX);
to
long double prechalf = nextafterl (0.5L, LDBL_MAX);
This is the orginal code in the latest snapshot:
#else
/* Poor version of roundl for system that don't have ceill. */
long double
roundl (long double x)
{
if (x > DBL_MAX || x < -DBL_MAX)
{
#ifdef HAVE_NEXTAFTERL
static long double prechalf = nexafterl (0.5L, LDBL_MAX);
#else
static long double prechalf = 0.5L;
#endif
return (GFC_INTEGER_LARGEST) (x + (x > 0 ? prechalf : -prechalf));
}
else
/* Use round(). */
return round ((double) x);
}
#endif
#endif
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libfortran/47830] errors in intrinsics/c99_functions.c
2011-02-21 8:26 [Bug libfortran/47830] New: errors in intrinsics/c99_functions.c kuehro at gmx dot de
@ 2011-02-21 9:45 ` burnus at gcc dot gnu.org
2011-02-21 10:42 ` kuehro at gmx dot de
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-02-21 9:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47830
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |build
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.02.21 09:37:55
CC| |burnus at gcc dot gnu.org
Ever Confirmed|0 |1
Known to fail| |4.3.5, 4.4.5, 4.5.2, 4.6.0
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-21 09:37:55 UTC ---
Confirmed. In Fortran 2003 such a code would be valid ...
(In reply to comment #0)
> There are two errors
For those having - like me - problems to spot the second error:
> static long double prechalf = nexafterl (0.5L, LDBL_MAX);
> long double prechalf = nextafterl (0.5L, LDBL_MAX);
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libfortran/47830] errors in intrinsics/c99_functions.c
2011-02-21 8:26 [Bug libfortran/47830] New: errors in intrinsics/c99_functions.c kuehro at gmx dot de
2011-02-21 9:45 ` [Bug libfortran/47830] " burnus at gcc dot gnu.org
@ 2011-02-21 10:42 ` kuehro at gmx dot de
2011-02-21 12:05 ` burnus at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: kuehro at gmx dot de @ 2011-02-21 10:42 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47830
--- Comment #2 from Kai-Uwe Eckhardt <kuehro at gmx dot de> 2011-02-21 10:38:16 UTC ---
Hi,
> > There are two errors
>
> For those having - like me - problems to spot the second error:
>
> > static long double prechalf = nexafterl (0.5L, LDBL_MAX);
> > long double prechalf = nextafterl (0.5L, LDBL_MAX);
well besides the typo nexfaterl declaring a variable static in
block scope is evaluated as a const qualifier which cannot be
assigned using a function. At least the default compiler on
NetBSD gcc-4.1.3 tells me so. I tried to look it up in the C99
standard, if this is a compiler error or not. Mabey it would be cleaner
to put the declaration at the beginning of the function roundl.
Kai-Uwe Eckhardt
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libfortran/47830] errors in intrinsics/c99_functions.c
2011-02-21 8:26 [Bug libfortran/47830] New: errors in intrinsics/c99_functions.c kuehro at gmx dot de
2011-02-21 9:45 ` [Bug libfortran/47830] " burnus at gcc dot gnu.org
2011-02-21 10:42 ` kuehro at gmx dot de
@ 2011-02-21 12:05 ` burnus at gcc dot gnu.org
2011-02-22 12:43 ` burnus at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-02-21 12:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47830
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-21 11:19:33 UTC ---
(In reply to comment #2)
> well besides the typo nexfaterl
Well, that was actually the problem I had - my brain magically added the "t"
;-)
(For NetBSD there is also PR 39570, which is about cabsf warnings.)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libfortran/47830] errors in intrinsics/c99_functions.c
2011-02-21 8:26 [Bug libfortran/47830] New: errors in intrinsics/c99_functions.c kuehro at gmx dot de
` (2 preceding siblings ...)
2011-02-21 12:05 ` burnus at gcc dot gnu.org
@ 2011-02-22 12:43 ` burnus at gcc dot gnu.org
2011-02-22 12:44 ` burnus at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-02-22 12:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47830
--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-22 12:37:16 UTC ---
Author: burnus
Date: Tue Feb 22 12:37:12 2011
New Revision: 170396
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170396
Log:
2011-02-22 Tobias Burnus <burnus@net-b.de>
Kai-Uwe Eckhardt <kuehro@gmx.de>
PR libfortran/47830
* intrinsics/c99_functions.c (roundl): Make C valid for
HAVE_NEXTAFTERL.
Modified:
trunk/libgfortran/ChangeLog
trunk/libgfortran/intrinsics/c99_functions.c
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libfortran/47830] errors in intrinsics/c99_functions.c
2011-02-21 8:26 [Bug libfortran/47830] New: errors in intrinsics/c99_functions.c kuehro at gmx dot de
` (3 preceding siblings ...)
2011-02-22 12:43 ` burnus at gcc dot gnu.org
@ 2011-02-22 12:44 ` burnus at gcc dot gnu.org
2011-02-22 12:54 ` burnus at gcc dot gnu.org
2011-02-22 12:55 ` burnus at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-02-22 12:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47830
--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-22 12:41:57 UTC ---
Author: burnus
Date: Tue Feb 22 12:41:54 2011
New Revision: 170397
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170397
Log:
2011-02-22 Tobias Burnus <burnus@net-b.de>
Kai-Uwe Eckhardt <kuehro@gmx.de>
PR libfortran/47830
* intrinsics/c99_functions.c (roundl): Make C valid for
HAVE_NEXTAFTERL.
Modified:
branches/gcc-4_5-branch/libgfortran/ChangeLog
branches/gcc-4_5-branch/libgfortran/intrinsics/c99_functions.c
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libfortran/47830] errors in intrinsics/c99_functions.c
2011-02-21 8:26 [Bug libfortran/47830] New: errors in intrinsics/c99_functions.c kuehro at gmx dot de
` (4 preceding siblings ...)
2011-02-22 12:44 ` burnus at gcc dot gnu.org
@ 2011-02-22 12:54 ` burnus at gcc dot gnu.org
2011-02-22 12:55 ` burnus at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-02-22 12:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47830
--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-22 12:43:42 UTC ---
Author: burnus
Date: Tue Feb 22 12:43:38 2011
New Revision: 170398
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170398
Log:
2011-02-22 Tobias Burnus <burnus@net-b.de>
Kai-Uwe Eckhardt <kuehro@gmx.de>
PR libfortran/47830
* intrinsics/c99_functions.c (roundl): Make C valid for
HAVE_NEXTAFTERL.
Modified:
branches/gcc-4_4-branch/libgfortran/ChangeLog
branches/gcc-4_4-branch/libgfortran/intrinsics/c99_functions.c
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libfortran/47830] errors in intrinsics/c99_functions.c
2011-02-21 8:26 [Bug libfortran/47830] New: errors in intrinsics/c99_functions.c kuehro at gmx dot de
` (5 preceding siblings ...)
2011-02-22 12:54 ` burnus at gcc dot gnu.org
@ 2011-02-22 12:55 ` burnus at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-02-22 12:55 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47830
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-22 12:44:20 UTC ---
FIXED on the trunk (4.6) and on the 4.4 and 4.5 branches.
Thanks for the report!
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-02-22 12:44 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-21 8:26 [Bug libfortran/47830] New: errors in intrinsics/c99_functions.c kuehro at gmx dot de
2011-02-21 9:45 ` [Bug libfortran/47830] " burnus at gcc dot gnu.org
2011-02-21 10:42 ` kuehro at gmx dot de
2011-02-21 12:05 ` burnus at gcc dot gnu.org
2011-02-22 12:43 ` burnus at gcc dot gnu.org
2011-02-22 12:44 ` burnus at gcc dot gnu.org
2011-02-22 12:54 ` burnus at gcc dot gnu.org
2011-02-22 12:55 ` burnus at gcc dot gnu.org
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).