This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Use C99 isfinite macro instead of finite when available


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]