This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Use C99 isfinite macro instead of finite when available
- From: Paul Brook <paul at codesourcery dot com>
- To: fortran at gcc dot gnu dot org
- Cc: Steven Bosscher <stevenb at suse dot de>,"John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>,gcc-patches at gcc dot gnu dot org
- Date: Mon, 23 Aug 2004 15:05:24 +0100
- Subject: Re: [PATCH] Use C99 isfinite macro instead of finite when available
- Organization: CodeSourcery
- References: <200408141920.i7EJKgwl003623@hiauly1.hia.nrc.ca> <200408231553.26548.stevenb@suse.de>
On Monday 23 August 2004 14:53, Steven Bosscher wrote:
> On Saturday 14 August 2004 21:20, John David Anglin wrote:
> > This fixes a bunch of gfortran failures under HP-UX 11.x which doesn't
> > have the finite function, only the isfinite macro.
> >
> > Tested on hppa2.0w-hp-hpux11.11.
> >
> > Ok for main?
>
> Sorry for not following up more quickly (thanks Tobi ;-)
>
> About your change,
>
> * io/write.c (write_float): Use isfinite macro when available.
>
> I wonder if this should be a configure check, I'm no fan of rogue
> #ifdefs in the library. According to my man pages, isfinite is C99,
> and finite comes from BSD, so I suppose we should prefer isfinite,
> so at least that's correct.
>
> libstdc++ has FINITE_P and GLIBCXX_ENABLE_C99. I suppose we need
> something like that for libgfortran too... If you have time, that'd
> be much appreciated. Otherwise I'll take care of it next weekend.
I agree that a configure test is The Right Thing(tm) to do. Existing tests
test for specific functionality (in this case isfinite) rather than a blanket
HAVE_C99 test.
I think a blanket HAVE_C99 macro probably going to cause problems as some
targets provide a subset of the C99 functionality. The libstdc++ macro was
split up recently for precisely this reason.
Paul