|
From: Gilles D. <gr...@sc...> - 2002-04-19 16:38:32
|
According to Edward Avis:
> On Fri, 19 Apr 2002, Gilles Detillieux wrote:
> >>>>Another problem I found was the use of deprecated headers. Instead of
> >>>><foo.h> newer compilers would prefer you to use <foo>
>
> >>>Yes, and lots of people have older compilers that don't like the <foo>
> >>>notation.
> >>
> >>Even today?
>
> >Would it surprise you to learn that I still regularly build ht://Dig
> >with gcc version 2.7.2.1?
>
> I thought that gcc 2.7.2 was new enough to support the <foo> include
> notation, but maybe this is not the case.
[grdetil@cliff ~]$ cat t.cc
#include <ostream>
main() { cout << "Hello, world!\n"; }
[grdetil@cliff ~]$ g++ t.cc
t.cc:1: ostream: No such file or directory
[grdetil@cliff ~]$ cat t2.cc
#include <ostream.h>
main() { cout << "Hello, world!\n"; }
[grdetil@cliff ~]$ g++ t2.cc
[grdetil@cliff ~]$
Even if it did support the <ostream> notation, would it be safe to assume
that no one would attempt to build ht://Dig with an older compiler that
didn't?
> >The ".h" in header file names is a very well established, decades-old
> >standard that's not going to disappear overnight. It's cool that newer
> >compilers make the .h optional, but that some of these compilers now
> >give warning messages, or even error messages, when the .h is there is,
> >in my opinion, a capricious and poorly thought-out deviation from this
> >established standard.
>
> The newer compilers are just trying to follow the C++ standard, you
> can't fault them for that. Giving a fatal error for the foo.h form is a
> bit much I agree, but a warning message is reasonable. The problem here
> is that the configure script is very touchy and thinks the
> compiler warning means that <fstream.h> won't work.
Well, yeah, I'd put this down to a bug in either autoconf or the configure
script itself. If we're aiming for portability, we need to workaround not
only older compilers, but also dogmatic newer ones that issue warnings for
frivolous reasons. We can't afford to treat such warnings as fatal errors.
--
Gilles R. Detillieux E-mail: <gr...@sc...>
Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/
Dept. Physiology, U. of Manitoba Winnipeg, MB R3E 3J7 (Canada)
|