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: unassig...@gcc.gnu.org
        ReportedBy: kue...@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

Reply via email to