Topic: Header names


Author: Stephen.Clamage@Eng.Sun.COM (Steve Clamage)
Date: 1997/02/12
Raw View
In article 3702@mds.rmit.edu.au, Marcelo Cantos <marcelo@mds.rmit.edu.au> writes:
>Mikael St=E5ldal wrote:
>> =
>
>> In some C++ compilers, there is some problems with header naming. E.g. =
>the
>> header for I/O-streams on char[] is named <strstream.h> on UNIX and
>> <strstrea.h> on MS-DOS (because MS-DOS can't handle more than 8 chars
>> before the period in filenames). Does the standard remedy this problem?=
>
>
>It didn't need to before, because #include <strstream.h> still worked on
>DOS compilers -- DOS just ignores overflow characters.
>
>The current standard goes further and says that the handling of
>#include <strstream> is implementation defined, as long as it brings
>into the current environment the definitions as stipulated by the
>standard.  This means that <strstream> could refer to a header file
>strstream.h, or a header file strstream which #includes strstream.h
>(or strstrea which includes strstrea.h).  In fact, the compiler
>could look up 'strstream' in a database of pre-compiled header
>objects (this will probably become the trend)!

There is nothing new in what you say. The C++ standard merely follows
the C Standard (from 1989) in that regard.

>Note that this only applies to standard headers.  To include your
>own header files, you now have to use #include "..." instead of
>#include <...>.

Again, the C++ rule is the same as the old C rule. The effect of
 #include <something>
is precisely defined by the C and C++ standards only when "something"
corresponds to the spelling of a standard header. The use of
 #include "something"
causes the processor to look in possibly different implementation-
defined places for a source file before looking in the places it
would look if the directive used angle-brackets instead of quotes.
---
Steve Clamage, stephen.clamage@eng.sun.com
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]





Author: Valentin Bonnard <bonnardv@pratique.fr>
Date: 1997/02/13
Raw View
Mikael St=C2ldal wrote:
        ^^^ not an ASCII char.
> In some C++ compilers, there is some problems with header naming. E.g. =
the
> header for I/O-streams on char[] is named <strstream.h> on UNIX and
> <strstrea.h> on MS-DOS (because MS-DOS can't handle more than 8 chars
> before the period in filenames). Does the standard remedy this problem?

Compilers should use standard names: strstream.h, strstream (names=20
defined in namespace std) (or stringstream ?? for the new=20
[io]stringstream).

If they need to, they can then cut the name to fit a particular=20
file-system rule. For example they can just take the first 8 chars.

But they can also map include <> names to a database of precompiled=20
headers (it could speed up compilation greatly) and not use files=20
at all.

--=20

Valentin Bonnard
mailto:bonnardv@pratique.fr
http://www.pratique.fr/~bonnardv (Informations sur le C++ en Francais)
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]





Author: 917312523 <helmut.zeisel@aon.at>
Date: 1997/02/16
Raw View
I think somewhere I read that the include statement
for standard headers is now without any "<", i.e.

#include something

instead of

#include <something>

for standard header files. Has this version ever been discussed?
At least the new VMS C++ compiler offers this way.

Helmut Zeisel
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]





Author: fjh@murlibobo.cs.mu.OZ.AU (Fergus Henderson)
Date: 1997/02/17
Raw View
917312523 <helmut.zeisel@aon.at> writes:

>I think somewhere I read that the include statement
>for standard headers is now without any "<", i.e.
>
>#include something
>
>instead of
>
>#include <something>
>
>for standard header files.

That's not correct.  Perhaps you're confusing it with another change --
the include statement for standard headers is now without any ".h", i.e.

 #include <iostream>

instead of

 #include <iostream.h>

>At least the new VMS C++ compiler offers this way.

If so, that's a non-standard extension.

--
Fergus Henderson <fjh@cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3         |     -- the last words of T. S. Garp.
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]





Author: Stephen.Clamage@eng.sun.com (Steve Clamage)
Date: 1997/02/17
Raw View
In article 2B4@aon.at, 917312523 <helmut.zeisel@aon.at> writes:
>I think somewhere I read that the include statement
>for standard headers is now without any "<", i.e.
>
>#include something
>
>instead of
>
>#include <something>
>
>for standard header files. Has this version ever been discussed?
>At least the new VMS C++ compiler offers this way.

No, that is not and never has been standard C or C++.

However, DEC VMS C has for very many years allowed
 #include something
as their version of precompiled standard headers, and that feature
was carried over into VAX C++. This extended syntax has no semantic
difference from using angle brackets, but saves compile time.
---
Steve Clamage, stephen.clamage@eng.sun.com
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]





Author: "Brian J. McCarthy" <mccarthy@hndymn.zko.dec.com>
Date: 1997/02/19
Raw View
> >At least the new VMS C++ compiler offers this way.
>

I can't find the original posting with this (our news servers got a
little sick for a while).

Anyway, as Steve Clamage pointed out, OpenVMS C++ and DEC C, both
allow #include <foo> which would include foo.hxx (for C++) or
foo.h (for C).

It was a VAX C extention that made its way (for upward compatability)
into the C and C++ compiler offerings.  It actually ment "go find
this file in a text library".  A text library is an archive library
for ASCII text files.

When the new standard said "we shall be #include <foo>" with no
extention, the C++ compiler needed to change to avoid conficts
between iostream.h[xx] (pre-standard) and <iostream> (standard).
The compiler added a switch (in OpenVMS terms, a qualifier) that
must be used when using new standard library header files:

cxx/assume=noheader_type_default

(try cxx/ass=nohead for short :-)

Which will cause the compiler to find the correct header file.

--
-----------------------------------------------------------------------
Brian J. McCarthy                  | mailto:mccarthy@hndymn.zko.dec.com
Digital Equipment Corp. Nashua, NH | DEC CRTL/DEC C++ Class Libraries
-----------------------------------------------------------------------
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]





Author: fjh@murlibobo.cs.mu.OZ.AU (Fergus Henderson)
Date: 1997/02/11
Raw View
d96-mst@nada.kth.se (Mikael Steldal) writes:

>In some C++ compilers, there is some problems with header naming.

It is possible that you are right, but I suspect you may be mistaken.

If there is a problem, it is a problem with those C++ compilers,
not with the draft C++ standard.

>E.g. the
>header for I/O-streams on char[] is named <strstream.h> on UNIX and
><strstrea.h> on MS-DOS (because MS-DOS can't handle more than 8 chars
>before the period in filenames).

Every MS-DOS C++ compiler I've used treats

 #include <strstream.h>

just fine.  If yours doesn't, I suggest that you contact your vendor.
<strstream.h> is not a standard header file, but there are standard
header files such as <algorithm> and <functional> that have names
long than 8 characters, and any conforming C++ compiler is required
to support such names.

>Does the standard remedy this problem?

Yes, the C standard remedied this problem, and the C++ standard
has not changed the situation.  The name in between angle brackets
need not be the same as the file name on disk.

--
Fergus Henderson <fjh@cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3         |     -- the last words of T. S. Garp.
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]





Author: Marcelo Cantos <marcelo@mds.rmit.edu.au>
Date: 1997/02/11
Raw View
Mikael St=E5ldal wrote:
> =

> In some C++ compilers, there is some problems with header naming. E.g. =
the
> header for I/O-streams on char[] is named <strstream.h> on UNIX and
> <strstrea.h> on MS-DOS (because MS-DOS can't handle more than 8 chars
> before the period in filenames). Does the standard remedy this problem?=


It didn't need to before, because #include <strstream.h> still worked on
DOS compilers -- DOS just ignores overflow characters.

The current standard goes further and says that the handling of
#include <strstream> is implementation defined, as long as it brings
into the current environment the definitions as stipulated by the
standard.  This means that <strstream> could refer to a header file
strstream.h, or a header file strstream which #includes strstream.h
(or strstrea which includes strstrea.h).  In fact, the compiler
could look up 'strstream' in a database of pre-compiled header
objects (this will probably become the trend)!

Note that this only applies to standard headers.  To include your
own header files, you now have to use #include "..." instead of
#include <...>.


-- =

___________________________________________________________________
Marcelo Cantos, Research Assistant          marcelo@mds.rmit.edu.au
Multimedia Database Systems Group              Tel: +61-3-9282-2497
723 Swanston St, Carlton VIC 3053, Australia   Fax: +61-3-9282-2490
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]





Author: d96-mst@nada.kth.se (Mikael St ldal)
Date: 1997/02/11
Raw View
In some C++ compilers, there is some problems with header naming. E.g. the
header for I/O-streams on char[] is named <strstream.h> on UNIX and
<strstrea.h> on MS-DOS (because MS-DOS can't handle more than 8 chars
before the period in filenames). Does the standard remedy this problem?

[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]