This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Standard header format.
- From: "Steven T. Hatton" <hattons at globalsymmetry dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Sat, 5 Jun 2004 10:55:49 -0400
- Subject: Standard header format.
- Organization: Global Symmetry
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I've discovered that the files representing the Standard Library headers in a
GCC distrubution are not direct representations of the interface described in
ISO/IEC 14882. The files I'm talking about are listed by the following
command, assuming GNU_GCC points to the root of the gcc-3.3.3 installation.
Sat Jun 05 10:27:32:> for f in $(find $GNU_GCC/include/c++/3.3.3 -type f
- -maxdepth 1); do echo "gcc"${f##*/gcc}; done
gcc-3.3.3/include/c++/3.3.3/ios
gcc-3.3.3/include/c++/3.3.3/map
gcc-3.3.3/include/c++/3.3.3/new
gcc-3.3.3/include/c++/3.3.3/set
gcc-3.3.3/include/c++/3.3.3/clocale
gcc-3.3.3/include/c++/3.3.3/list
gcc-3.3.3/include/c++/3.3.3/complex
...
gcc-3.3.3/include/c++/3.3.3/vector
gcc-3.3.3/include/c++/3.3.3/exception_defines.h
gcc-3.3.3/include/c++/3.3.3/numeric
gcc-3.3.3/include/c++/3.3.3/utility
gcc-3.3.3/include/c++/3.3.3/ostream
gcc-3.3.3/include/c++/3.3.3/valarray
gcc-3.3.3/include/c++/3.3.3/cassert
gcc-3.3.3/include/c++/3.3.3/iomanip
gcc-3.3.3/include/c++/3.3.3/cxxabi.h
gcc-3.3.3/include/c++/3.3.3/ciso646
gcc-3.3.3/include/c++/3.3.3/istream
gcc-3.3.3/include/c++/3.3.3/climits
Clearly there is more here than the entry points to the Standard Library
header implementation. But I believe this listing is a superset of the files
referenced by the #include <[header name]> directives.
In the case of valarray, the file does seem to list the declarations specified
in the Standard. OTOH vector consists of the following:
/** @file vector
* This is a Standard C++ Library header. You should @c #include this header
* in your programs, rather than any of the "st[dl]_*.h" implementation
files.
*/
#ifndef _CPP_VECTOR
#define _CPP_VECTOR 1
#pragma GCC system_header
#include <bits/functexcept.h>
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_vector.h>
#include <bits/stl_bvector.h>
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# include <bits/vector.tcc>
#endif
#endif /* _CPP_VECTOR */
In TC++PL(SE) Stroustrup suggests I look at the standard headers for my C++
implementation to see the interface for the components of the Standard
Library. Clearly, this is not a straight forward exercise with a GCC
implementation. That presents a minor problem for me. There is, however, a
bigger drawback to the current arrangement. If I want to automatically
process the standard header interface to create a code completion or
edit-time error detections mechanism, I cannot directly use the files
generated by the command above. I'm not even sure I could create the kind of
data structure necessary to support the functionality by processing the GCC
headers.
Is there an easy way to extract the interface declarations for the Standard
Library from the GCC include hierarchy? If not, I propose that either that
mechanism be created, or some means of providing a direct representation of
the standard headers be part of the GCC distribution.
For a bit more information on my reasoning and motivation see my recent posts
to the gnu.g++.help news group. The message with the following ID in
particular:
news:<z6adnWcK7_6sAF3d4p2dnA@speakeasy.net>
- --
Regards,
Steven
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFAwd78wX61+IL0QsMRAg/FAKC9G68vKecd+WkrvQQAiBzZUDTt7wCeJXI2
1rFppBpuTWfYkrNUu7ltjNU=
=wYpk
-----END PGP SIGNATURE-----