head 1.1;
branch 1.1.1;
access;
symbols
perseant-exfatfs-base-20261102:1.1.1.9
netbsd-11-1-RELEASE:1.1.1.9
gcc-14-4-0:1.1.1.9
netbsd-10-2-RELEASE:1.1.1.8
netbsd-9-5-RELEASE:1.1.1.4
netbsd-11-0-RELEASE:1.1.1.9
netbsd-11-0-RC7:1.1.1.9
netbsd-11-0-RC6:1.1.1.9
netbsd-11-0-RC5:1.1.1.9
netbsd-11-0-RC4:1.1.1.9
netbsd-11-0-RC3:1.1.1.9
netbsd-11-0-RC2:1.1.1.9
netbsd-11-0-RC1:1.1.1.9
gcc-14-3-0:1.1.1.9
perseant-exfatfs-base-20250801:1.1.1.9
netbsd-11:1.1.1.9.0.4
netbsd-11-base:1.1.1.9
gcc-12-5-0:1.1.1.9
netbsd-10-1-RELEASE:1.1.1.8
perseant-exfatfs-base-20240630:1.1.1.9
gcc-12-4-0:1.1.1.9
perseant-exfatfs:1.1.1.9.0.2
perseant-exfatfs-base:1.1.1.9
netbsd-8-3-RELEASE:1.1.1.3
netbsd-9-4-RELEASE:1.1.1.4
netbsd-10-0-RELEASE:1.1.1.8
netbsd-10-0-RC6:1.1.1.8
netbsd-10-0-RC5:1.1.1.8
netbsd-10-0-RC4:1.1.1.8
netbsd-10-0-RC3:1.1.1.8
netbsd-10-0-RC2:1.1.1.8
netbsd-10-0-RC1:1.1.1.8
gcc-12-3-0:1.1.1.9
gcc-10-5-0:1.1.1.8
netbsd-10:1.1.1.8.0.6
netbsd-10-base:1.1.1.8
netbsd-9-3-RELEASE:1.1.1.4
gcc-10-4-0:1.1.1.8
cjep_sun2x-base1:1.1.1.8
cjep_sun2x:1.1.1.8.0.4
cjep_sun2x-base:1.1.1.8
cjep_staticlib_x-base1:1.1.1.8
netbsd-9-2-RELEASE:1.1.1.4
cjep_staticlib_x:1.1.1.8.0.2
cjep_staticlib_x-base:1.1.1.8
gcc-10-3-0:1.1.1.8
netbsd-9-1-RELEASE:1.1.1.4
gcc-9-3-0:1.1.1.8
gcc-7-5-0:1.1.1.6
phil-wifi-20200421:1.1.1.5
phil-wifi-20200411:1.1.1.5
is-mlppp:1.1.1.5.0.2
is-mlppp-base:1.1.1.5
phil-wifi-20200406:1.1.1.5
netbsd-8-2-RELEASE:1.1.1.3
gcc-8-4-0:1.1.1.7
netbsd-9-0-RELEASE:1.1.1.4
netbsd-9-0-RC2:1.1.1.4
netbsd-9-0-RC1:1.1.1.4
phil-wifi-20191119:1.1.1.5
gcc-8-3-0:1.1.1.5
netbsd-9:1.1.1.4.0.2
netbsd-9-base:1.1.1.4
phil-wifi-20190609:1.1.1.4
netbsd-8-1-RELEASE:1.1.1.3
netbsd-8-1-RC1:1.1.1.3
pgoyette-compat-merge-20190127:1.1.1.3.14.1
pgoyette-compat-20190127:1.1.1.4
gcc-7-4-0:1.1.1.4
pgoyette-compat-20190118:1.1.1.3
pgoyette-compat-1226:1.1.1.3
pgoyette-compat-1126:1.1.1.3
gcc-6-5-0:1.1.1.3
pgoyette-compat-1020:1.1.1.3
pgoyette-compat-0930:1.1.1.3
pgoyette-compat-0906:1.1.1.3
netbsd-7-2-RELEASE:1.1.1.2
pgoyette-compat-0728:1.1.1.3
netbsd-8-0-RELEASE:1.1.1.3
phil-wifi:1.1.1.3.0.16
phil-wifi-base:1.1.1.3
pgoyette-compat-0625:1.1.1.3
netbsd-8-0-RC2:1.1.1.3
pgoyette-compat-0521:1.1.1.3
pgoyette-compat-0502:1.1.1.3
pgoyette-compat-0422:1.1.1.3
netbsd-8-0-RC1:1.1.1.3
pgoyette-compat-0415:1.1.1.3
pgoyette-compat-0407:1.1.1.3
pgoyette-compat-0330:1.1.1.3
pgoyette-compat-0322:1.1.1.3
pgoyette-compat-0315:1.1.1.3
netbsd-7-1-2-RELEASE:1.1.1.2
pgoyette-compat:1.1.1.3.0.14
pgoyette-compat-base:1.1.1.3
gcc-6-4-0:1.1.1.3
netbsd-7-1-1-RELEASE:1.1.1.2
gcc-5-5-0:1.1.1.3
matt-nb8-mediatek:1.1.1.3.0.12
matt-nb8-mediatek-base:1.1.1.3
perseant-stdc-iso10646:1.1.1.3.0.10
perseant-stdc-iso10646-base:1.1.1.3
netbsd-8:1.1.1.3.0.8
netbsd-8-base:1.1.1.3
prg-localcount2-base3:1.1.1.3
prg-localcount2-base2:1.1.1.3
prg-localcount2-base1:1.1.1.3
prg-localcount2:1.1.1.3.0.6
prg-localcount2-base:1.1.1.3
pgoyette-localcount-20170426:1.1.1.3
bouyer-socketcan-base1:1.1.1.3
pgoyette-localcount-20170320:1.1.1.3
netbsd-7-1:1.1.1.2.0.10
netbsd-7-1-RELEASE:1.1.1.2
netbsd-7-1-RC2:1.1.1.2
netbsd-7-nhusb-base-20170116:1.1.1.2
bouyer-socketcan:1.1.1.3.0.4
bouyer-socketcan-base:1.1.1.3
pgoyette-localcount-20170107:1.1.1.3
netbsd-7-1-RC1:1.1.1.2
pgoyette-localcount-20161104:1.1.1.3
netbsd-7-0-2-RELEASE:1.1.1.2
localcount-20160914:1.1.1.3
netbsd-7-nhusb:1.1.1.2.0.8
netbsd-7-nhusb-base:1.1.1.2
pgoyette-localcount-20160806:1.1.1.3
pgoyette-localcount-20160726:1.1.1.3
pgoyette-localcount:1.1.1.3.0.2
pgoyette-localcount-base:1.1.1.3
gcc-5-4-0:1.1.1.3
netbsd-7-0-1-RELEASE:1.1.1.2
gcc-5-3-0:1.1.1.3
netbsd-7-0:1.1.1.2.0.6
netbsd-7-0-RELEASE:1.1.1.2
gcc-4-8-5-pre-gcc-old-import:1.1.1.2
netbsd-7-0-RC3:1.1.1.2
netbsd-7-0-RC2:1.1.1.2
post-gcc-4-8-5-merge:1.1.1.2
gcc-4-8-5:1.1.1.2
netbsd-7-0-RC1:1.1.1.2
gcc-4-8-4:1.1.1.2
gcc-4-8-20141009:1.1.1.2
netbsd-6-0-6-RELEASE:1.1.1.1
netbsd-6-1-5-RELEASE:1.1.1.1
netbsd-7:1.1.1.2.0.4
netbsd-7-base:1.1.1.2
gcc-4-8-3:1.1.1.2
yamt-pagecache-base9:1.1.1.2
yamt-pagecache-tag8:1.1.1.1
netbsd-6-1-4-RELEASE:1.1.1.1
netbsd-6-0-5-RELEASE:1.1.1.1
tls-earlyentropy:1.1.1.2.0.2
tls-earlyentropy-base:1.1.1.2
riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.2
riastradh-drm2-base3:1.1.1.2
gcc-4-8-3-pre-r208254:1.1.1.2
gcc-4-8-3-pre-r206687:1.1.1.2
imported-to-gcc-old-20140227-0107:1.1.1.1
netbsd-6-1-3-RELEASE:1.1.1.1
netbsd-6-0-4-RELEASE:1.1.1.1
netbsd-6-1-2-RELEASE:1.1.1.1
netbsd-6-0-3-RELEASE:1.1.1.1
netbsd-6-1-1-RELEASE:1.1.1.1
riastradh-drm2-base2:1.1.1.1
riastradh-drm2-base1:1.1.1.1
riastradh-drm2:1.1.1.1.0.12
riastradh-drm2-base:1.1.1.1
netbsd-6-1:1.1.1.1.0.16
netbsd-6-0-2-RELEASE:1.1.1.1
netbsd-6-1-RELEASE:1.1.1.1
netbsd-6-1-RC4:1.1.1.1
netbsd-6-1-RC3:1.1.1.1
agc-symver:1.1.1.1.0.14
agc-symver-base:1.1.1.1
netbsd-6-1-RC2:1.1.1.1
netbsd-6-1-RC1:1.1.1.1
yamt-pagecache-base8:1.1.1.1
netbsd-6-0-1-RELEASE:1.1.1.1
yamt-pagecache-base7:1.1.1.1
matt-nb6-plus-nbase:1.1.1.1
yamt-pagecache-base6:1.1.1.1
netbsd-6-0:1.1.1.1.0.10
netbsd-6-0-RELEASE:1.1.1.1
gcc-4-5-4:1.1.1.1
netbsd-6-0-RC2:1.1.1.1
tls-maxphys:1.1.1.1.0.8
tls-maxphys-base:1.1.1.2
matt-nb6-plus:1.1.1.1.0.6
matt-nb6-plus-base:1.1.1.1
netbsd-6-0-RC1:1.1.1.1
yamt-pagecache-base5:1.1.1.1
yamt-pagecache-base4:1.1.1.1
netbsd-6:1.1.1.1.0.4
netbsd-6-base:1.1.1.1
yamt-pagecache-base3:1.1.1.1
yamt-pagecache-base2:1.1.1.1
yamt-pagecache:1.1.1.1.0.2
yamt-pagecache-base:1.1.1.1
gcc-4-5-3:1.1.1.1
FSF:1.1.1;
locks; strict;
comment @# @;
1.1
date 2011.06.21.01.24.28; author mrg; state Exp;
branches
1.1.1.1;
next ;
1.1.1.1
date 2011.06.21.01.24.28; author mrg; state Exp;
branches
1.1.1.1.2.1
1.1.1.1.8.1;
next 1.1.1.2;
1.1.1.2
date 2014.03.01.08.41.20; author mrg; state Exp;
branches;
next 1.1.1.3;
commitid TtaB91QNTknAoYqx;
1.1.1.3
date 2016.01.24.06.05.47; author mrg; state Exp;
branches
1.1.1.3.14.1
1.1.1.3.16.1;
next 1.1.1.4;
commitid uWWfbLp08zOK79Sy;
1.1.1.4
date 2019.01.19.10.14.09; author mrg; state Exp;
branches;
next 1.1.1.5;
commitid VQ8OwWIg5RS9kn8B;
1.1.1.5
date 2019.10.01.09.36.11; author mrg; state Exp;
branches;
next 1.1.1.6;
commitid smvgr2IPAQDr89FB;
1.1.1.6
date 2020.08.11.05.10.37; author mrg; state Exp;
branches;
next 1.1.1.7;
commitid 5dBRDT7i6e65xBjC;
1.1.1.7
date 2020.08.11.05.30.14; author mrg; state Exp;
branches;
next 1.1.1.8;
commitid 7AI4OfpLi4eqEBjC;
1.1.1.8
date 2020.09.05.07.52.15; author mrg; state Exp;
branches;
next 1.1.1.9;
commitid ZRYA7IOuwfMjAPmC;
1.1.1.9
date 2023.07.30.05.21.23; author mrg; state Exp;
branches;
next ;
commitid tk6nV4mbc9nVEMyE;
1.1.1.1.2.1
date 2014.05.22.16.37.47; author yamt; state Exp;
branches;
next ;
commitid DX8bafDLmqEbpyBx;
1.1.1.1.8.1
date 2014.08.19.23.54.48; author tls; state Exp;
branches;
next ;
commitid jTnpym9Qu0o4R1Nx;
1.1.1.3.14.1
date 2019.01.26.21.59.32; author pgoyette; state Exp;
branches;
next ;
commitid JKpcmvSjdT25dl9B;
1.1.1.3.16.1
date 2019.06.10.21.54.49; author christos; state Exp;
branches;
next 1.1.1.3.16.2;
commitid jtc8rnCzWiEEHGqB;
1.1.1.3.16.2
date 2020.04.13.07.58.35; author martin; state Exp;
branches;
next ;
commitid X01YhRUPVUDaec4C;
desc
@@
1.1
log
@Initial revision
@
text
@
ISO C++
backwards
Backwards CompatibilityFirstThe first generation GNU C++ library was called libg++. It was a
separate GNU project, although reliably paired with GCC. Rumors imply
that it had a working relationship with at least two kinds of
dinosaur.
Some background: libg++ was designed and created when there was no
ISO standard to provide guidance. Classes like linked lists are now
provided for by list<T> and do not need to be
created by genclass. (For that matter, templates exist
now and are well-supported, whereas genclass (mostly) predates them.)
There are other classes in libg++ that are not specified in the
ISO Standard (e.g., statistical analysis). While there are a lot of
really useful things that are used by a lot of people, the Standards
Committee couldn't include everything, and so a lot of those
obvious classes didn't get included.
Known Issues include many of the limitations of its immediate ancestor.Portability notes and known implementation limitations are as follows.No ios_base At least some older implementations don't have std::ios_base, so you should use std::ios::badbit, std::ios::failbit and std::ios::eofbit and std::ios::goodbit.
No cout in ostream.h, no cin in istream.h
In earlier versions of the standard,
fstream.h,
ostream.h
and istream.h
used to define
cout, cin and so on. ISO C++ specifies that one needs to include
iostream
explicitly to get the required definitions.
Some include adjustment may be required.This project is no longer maintained or supported, and the sources
archived. For the desperate,
the GCC extensions
page describes where to find the last libg++ source. The code is
considered replaced and rewritten.
Second
The second generation GNU C++ library was called libstdc++, or
libstdc++-v2. It spans the time between libg++ and pre-ISO C++
standardization and is usually associated with the following GCC
releases: egcs 1.x, gcc 2.95, and gcc 2.96.
The STL portions of this library are based on SGI/HP STL release 3.11.
This project is no longer maintained or supported, and the sources
archived. The code is considered replaced and rewritten.
Portability notes and known implementation limitations are as follows.
Namespace std:: not supported
Some care is required to support C++ compiler and or library
implementation that do not have the standard library in
namespace std.
The following sections list some possible solutions to support compilers
that cannot ignore std::-qualified names.
First, see if the compiler has a flag for this. Namespace
back-portability-issues are generally not a problem for g++
compilers that do not have libstdc++ in std::, as the
compilers use -fno-honor-std (ignore
std::, :: = std::) by default. That is,
the responsibility for enabling or disabling std:: is
on the user; the maintainer does not have to care about it. This
probably applies to some other compilers as well.
Second, experiment with a variety of pre-processor tricks.
By defining std as a macro, fully-qualified namespace
calls become global. Volia.
#ifdef WICKEDLY_OLD_COMPILER
# define std
#endif
Thanks to Juergen Heinzl who posted this solution on gnu.gcc.help.
Another pre-processor based approach is to define a macro
NAMESPACE_STD, which is defined to either
or std based on a compile-type
test. On GNU systems, this can be done with autotools by means of
an autoconf test (see below) for HAVE_NAMESPACE_STD,
then using that to set a value for the NAMESPACE_STD
macro. At that point, one is able to use
NAMESPACE_STD::string, which will evaluate to
std::string or ::string (i.e., in the
global namespace on systems that do not put string in
std::).
dnl @@synopsis AC_CXX_NAMESPACE_STD
dnl
dnl If the compiler supports namespace std, define
dnl HAVE_NAMESPACE_STD.
dnl
dnl @@category Cxx
dnl @@author Todd Veldhuizen
dnl @@author Luc Maisonobe <luc@@spaceroots.org>
dnl @@version 2004-02-04
dnl @@license AllPermissive
AC_DEFUN([AC_CXX_NAMESPACE_STD], [
AC_CACHE_CHECK(if g++ supports namespace std,
ac_cv_cxx_have_std_namespace,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <iostream>
std::istream& is = std::cin;],,
ac_cv_cxx_have_std_namespace=yes, ac_cv_cxx_have_std_namespace=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_have_std_namespace" = yes; then
AC_DEFINE(HAVE_NAMESPACE_STD,,[Define if g++ supports namespace std. ])
fi
])
Illegal iterator usage
The following illustrate implementation-allowed illegal iterator
use, and then correct use.
you cannot do ostream::operator<<(iterator)
to print the address of the iterator => use
operator<< &*iterator instead
you cannot clear an iterator's reference (iterator =
0) => use iterator = iterator_type();if (iterator) won't work any more => use
if (iterator != iterator_type())isspace from cctype is a macro
Glibc 2.0.x and 2.1.x define ctype.h functionality as macros
(isspace, isalpha etc.).
This implementations of libstdc++, however, keep these functions
as macros, and so it is not back-portable to use fully qualified
names. For example:
#include <cctype>
int main() { std::isspace('X'); }
Results in something like this:
std:: (__ctype_b[(int) ( ( 'X' ) )] & (unsigned short int) _ISspace ) ;
A solution is to modify a header-file so that the compiler tells
ctype.h to define functions
instead of macros:
// This keeps isalnum, et al from being propagated as macros.
#if __linux__
# define __NO_CTYPE 1
#endif
Then, include ctype.h
Another problem arises if you put a using namespace
std; declaration at the top, and include ctype.h. This will result in
ambiguities between the definitions in the global namespace
(ctype.h) and the
definitions in namespace std::
(<cctype>).
No vector::at, deque::at, string::at
One solution is to add an autoconf-test for this:
AC_MSG_CHECKING(for container::at)
AC_TRY_COMPILE(
[
#include <vector>
#include <deque>
#include <string>
using namespace std;
],
[
deque<int> test_deque(3);
test_deque.at(2);
vector<int> test_vector(2);
test_vector.at(1);
string test_string(test_string);
test_string.at(3);
],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_CONTAINER_AT)],
[AC_MSG_RESULT(no)])
If you are using other (non-GNU) compilers it might be a good idea
to check for string::at separately.
No std::char_traits<char>::eof
Use some kind of autoconf test, plus this:
#ifdef HAVE_CHAR_TRAITS
#define CPP_EOF std::char_traits<char>::eof()
#else
#define CPP_EOF EOF
#endif
No string::clear
There are two functions for deleting the contents of a string:
clear and erase (the latter returns the
string).
void
clear() { _M_mutate(0, this->size(), 0); }
basic_string&
erase(size_type __pos = 0, size_type __n = npos)
{
return this->replace(_M_check(__pos), _M_fold(__pos, __n),
_M_data(), _M_data());
}
Unfortunately, clear is not implemented in this
version, so you should use erase (which is probably
faster than operator=(charT*)).
Removal of ostream::form and istream::scan
extensions
These are no longer supported. Please use stringstreams instead.
No basic_stringbuf, basic_stringstream
Although the ISO standard i/ostringstream-classes are
provided, (sstream), for
compatibility with older implementations the pre-ISO
i/ostrstream (strstream) interface is also provided,
with these caveats:
strstream is considered to be deprecated
strstream is limited to char
with ostringstream you don't have to take care of
terminating the string or freeing its memory
istringstream can be re-filled (clear();
str(input);)
You can then use output-stringstreams like this:
#ifdef HAVE_SSTREAM
# include <sstream>
#else
# include <strstream>
#endif
#ifdef HAVE_SSTREAM
std::ostringstream oss;
#else
std::ostrstream oss;
#endif
oss << Name= << m_name << , number= << m_number << std::endl;
...
#ifndef HAVE_SSTREAM
oss << std::ends; // terminate the char*-string
#endif
// str() returns char* for ostrstream and a string for ostringstream
// this also causes ostrstream to think that the buffer's memory
// is yours
m_label.set_text(oss.str());
#ifndef HAVE_SSTREAM
// let the ostrstream take care of freeing the memory
oss.freeze(false);
#endif
Input-stringstreams can be used similarly:
std::string input;
...
#ifdef HAVE_SSTREAM
std::istringstream iss(input);
#else
std::istrstream iss(input.c_str());
#endif
int i;
iss >> i;
One (the only?) restriction is that an istrstream cannot be re-filled:
std::istringstream iss(numerator);
iss >> m_num;
// this is not possible with istrstream
iss.clear();
iss.str(denominator);
iss >> m_den;
If you don't care about speed, you can put these conversions in
a template-function:
template <class X>
void fromString(const string& input, X& any)
{
#ifdef HAVE_SSTREAM
std::istringstream iss(input);
#else
std::istrstream iss(input.c_str());
#endif
X temp;
iss >> temp;
if (iss.fail())
throw runtime_error(..)
any = temp;
}
Another example of using stringstreams is in this howto.
There is additional information in the libstdc++-v2 info files, in
particular info iostream.
Little or no wide character support
Classes wstring and
char_traits<wchar_t> are
not supported.
No templatized iostreams
Classes wfilebuf and
wstringstream are not supported.
Thread safety issues
Earlier GCC releases had a somewhat different approach to
threading configuration and proper compilation. Before GCC 3.0,
configuration of the threading model was dictated by compiler
command-line options and macros (both of which were somewhat
thread-implementation and port-specific). There were no
guarantees related to being able to link code compiled with one
set of options and macro setting with another set.
For GCC 3.0, configuration of the threading model used with
libraries and user-code is performed when GCC is configured and
built using the --enable-threads and --disable-threads options.
The ABI is stable for symbol name-mangling and limited functional
compatibility exists between code compiled under different
threading models.
The libstdc++ library has been designed so that it can be used in
multithreaded applications (with libstdc++-v2 this was only true
of the STL parts.) The first problem is finding a
fast method of implementation portable to
all platforms. Due to historical reasons, some of the library is
written against per-CPU-architecture spinlocks and other parts
against the gthr.h abstraction layer which is provided by gcc. A
minor problem that pops up every so often is different
interpretations of what "thread-safe" means for a
library (not a general program). We currently use the same
definition that SGI uses for their STL subset. However,
the exception for read-only containers only applies to the STL
components. This definition is widely-used and something similar
will be used in the next version of the C++ standard library.
Here is a small link farm to threads (no pun) in the mail
archives that discuss the threading problem. Each link is to the
first relevant message in the thread; from there you can use
"Thread Next" to move down the thread. This farm is in
latest-to-oldest order.
Our threading expert Loren gives a breakdown of the
six situations involving threads for the 3.0
release series.
This message inspired a recent updating of issues with
threading and the SGI STL library. It also contains some
example POSIX-multithreaded STL code.
(A large selection of links to older messages has been removed;
many of the messages from 1999 were lost in a disk crash, and the
few people with access to the backup tapes have been too swamped
with work to restore them. Many of the points have been
superseded anyhow.)
Third The third generation GNU C++ library is called libstdc++, or
libstdc++-v3.
The subset commonly known as the Standard Template Library
(chapters 23 through 25, mostly) is adapted from the final release
of the SGI STL (version 3.3), with extensive changes.
A more formal description of the V3 goals can be found in the
official design document.
Portability notes and known implementation limitations are as follows.Pre-ISO headers moved to backwards or removed The pre-ISO C++ headers
(iostream.h, defalloc.h etc.) are
available, unlike previous libstdc++ versions, but inclusion
generates a warning that you are using deprecated headers.
This compatibility layer is constructed by including the
standard C++ headers, and injecting any items in
std:: into the global namespace.
For those of you new to ISO C++ (welcome, time travelers!), no,
that isn't a typo. Yes, the headers really have new names.
Marshall Cline's C++ FAQ Lite has a good explanation in item
[27.4].
Some include adjustment may be required. What follows is an
autoconf test that defines PRE_STDCXX_HEADERS when they
exist.
# AC_HEADER_PRE_STDCXX
AC_DEFUN([AC_HEADER_PRE_STDCXX], [
AC_CACHE_CHECK(for pre-ISO C++ include files,
ac_cv_cxx_pre_stdcxx,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -Wno-deprecated"
# Omit defalloc.h, as compilation with newer compilers is problematic.
AC_TRY_COMPILE([
#include <new.h>
#include <iterator.h>
#include <alloc.h>
#include <set.h>
#include <hashtable.h>
#include <hash_set.h>
#include <fstream.h>
#include <tempbuf.h>
#include <istream.h>
#include <bvector.h>
#include <stack.h>
#include <rope.h>
#include <complex.h>
#include <ostream.h>
#include <heap.h>
#include <iostream.h>
#include <function.h>
#include <multimap.h>
#include <pair.h>
#include <stream.h>
#include <iomanip.h>
#include <slist.h>
#include <tree.h>
#include <vector.h>
#include <deque.h>
#include <multiset.h>
#include <list.h>
#include <map.h>
#include <algobase.h>
#include <hash_map.h>
#include <algo.h>
#include <queue.h>
#include <streambuf.h>
],,
ac_cv_cxx_pre_stdcxx=yes, ac_cv_cxx_pre_stdcxx=no)
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_pre_stdcxx" = yes; then
AC_DEFINE(PRE_STDCXX_HEADERS,,[Define if pre-ISO C++ header files are present. ])
fi
])
Porting between pre-ISO headers and ISO headers is simple: headers
like vector.h can be replaced with vector and a using
directive using namespace std; can be put at the global
scope. This should be enough to get this code compiling, assuming the
other usage is correct.
Extension headers hash_map, hash_set moved to ext or backwardsAt this time most of the features of the SGI STL extension have been
replaced by standardized libraries.
In particular, the unordered_map and unordered_set containers of TR1
are suitable replacement for the non-standard hash_map and hash_set
containers in the SGI STL.
Header files hash_map and hash_set moved
to ext/hash_map and ext/hash_set,
respectively. At the same time, all types in these files are enclosed
in namespace __gnu_cxx. Later versions move deprecate
these files, and suggest using TR1's unordered_map
and unordered_set instead.
The extensions are no longer in the global or std
namespaces, instead they are declared in the __gnu_cxx
namespace. For maximum portability, consider defining a namespace
alias to use to talk about extensions, e.g.:
#ifdef __GNUC__
#if __GNUC__ < 3
#include <hash_map.h>
namespace extension { using ::hash_map; }; // inherit globals
#else
#include <backward/hash_map>
#if __GNUC__ == 3 && __GNUC_MINOR__ == 0
namespace extension = std; // GCC 3.0
#else
namespace extension = ::__gnu_cxx; // GCC 3.1 and later
#endif
#endif
#else // ... there are other compilers, right?
namespace extension = std;
#endif
extension::hash_map<int,int> my_map;
This is a bit cleaner than defining typedefs for all the
instantiations you might need.
The following autoconf tests check for working HP/SGI hash containers.
# AC_HEADER_EXT_HASH_MAP
AC_DEFUN([AC_HEADER_EXT_HASH_MAP], [
AC_CACHE_CHECK(for ext/hash_map,
ac_cv_cxx_ext_hash_map,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -Werror"
AC_TRY_COMPILE([#include <ext/hash_map>], [using __gnu_cxx::hash_map;],
ac_cv_cxx_ext_hash_map=yes, ac_cv_cxx_ext_hash_map=no)
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_ext_hash_map" = yes; then
AC_DEFINE(HAVE_EXT_HASH_MAP,,[Define if ext/hash_map is present. ])
fi
])
# AC_HEADER_EXT_HASH_SET
AC_DEFUN([AC_HEADER_EXT_HASH_SET], [
AC_CACHE_CHECK(for ext/hash_set,
ac_cv_cxx_ext_hash_set,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -Werror"
AC_TRY_COMPILE([#include <ext/hash_set>], [using __gnu_cxx::hash_set;],
ac_cv_cxx_ext_hash_set=yes, ac_cv_cxx_ext_hash_set=no)
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_ext_hash_set" = yes; then
AC_DEFINE(HAVE_EXT_HASH_SET,,[Define if ext/hash_set is present. ])
fi
])
No ios::nocreate/ios::noreplace.
The existence of ios::nocreate being used for
input-streams has been confirmed, most probably because the author
thought it would be more correct to specify nocreate explicitly. So
it can be left out for input-streams.
For output streams, nocreate is probably the default,
unless you specify std::ios::trunc ? To be safe, you can
open the file for reading, check if it has been opened, and then
decide whether you want to create/replace or not. To my knowledge,
even older implementations support app, ate
and trunc (except for app ?).
No stream::attach(int fd)
Phil Edwards writes: It was considered and rejected for the ISO
standard. Not all environments use file descriptors. Of those
that do, not all of them use integers to represent them.
For a portable solution (among systems which use
file descriptors), you need to implement a subclass of
std::streambuf (or
std::basic_streambuf<..>) which opens a file
given a descriptor, and then pass an instance of this to the
stream-constructor.
An extension is available that implements this.
ext/stdio_filebuf.h contains a derived class called
__gnu_cxx::stdio_filebuf.
This class can be constructed from a C FILE* or a file
descriptor, and provides the fd() function.
For another example of this, refer to
fdstream example
by Nicolai Josuttis.
Support for C++98 dialect.
Check for complete library coverage of the C++1998/2003 standard.
# AC_HEADER_STDCXX_98
AC_DEFUN([AC_HEADER_STDCXX_98], [
AC_CACHE_CHECK(for ISO C++ 98 include files,
ac_cv_cxx_stdcxx_98,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
],,
ac_cv_cxx_stdcxx_98=yes, ac_cv_cxx_stdcxx_98=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_stdcxx_98" = yes; then
AC_DEFINE(STDCXX_98_HEADERS,,[Define if ISO C++ 1998 header files are present. ])
fi
])
Support for C++TR1 dialect.
Check for library coverage of the TR1 standard.
# AC_HEADER_STDCXX_TR1
AC_DEFUN([AC_HEADER_STDCXX_TR1], [
AC_CACHE_CHECK(for ISO C++ TR1 include files,
ac_cv_cxx_stdcxx_tr1,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
#include <tr1/array>
#include <tr1/ccomplex>
#include <tr1/cctype>
#include <tr1/cfenv>
#include <tr1/cfloat>
#include <tr1/cinttypes>
#include <tr1/climits>
#include <tr1/cmath>
#include <tr1/complex>
#include <tr1/cstdarg>
#include <tr1/cstdbool>
#include <tr1/cstdint>
#include <tr1/cstdio>
#include <tr1/cstdlib>
#include <tr1/ctgmath>
#include <tr1/ctime>
#include <tr1/cwchar>
#include <tr1/cwctype>
#include <tr1/functional>
#include <tr1/memory>
#include <tr1/random>
#include <tr1/regex>
#include <tr1/tuple>
#include <tr1/type_traits>
#include <tr1/unordered_set>
#include <tr1/unordered_map>
#include <tr1/utility>
],,
ac_cv_cxx_stdcxx_tr1=yes, ac_cv_cxx_stdcxx_tr1=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_stdcxx_tr1" = yes; then
AC_DEFINE(STDCXX_TR1_HEADERS,,[Define if ISO C++ TR1 header files are present. ])
fi
])
An alternative is to check just for specific TR1 includes, such as <unordered_map> and <unordered_set>.
# AC_HEADER_TR1_UNORDERED_MAP
AC_DEFUN([AC_HEADER_TR1_UNORDERED_MAP], [
AC_CACHE_CHECK(for tr1/unordered_map,
ac_cv_cxx_tr1_unordered_map,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <tr1/unordered_map>], [using std::tr1::unordered_map;],
ac_cv_cxx_tr1_unordered_map=yes, ac_cv_cxx_tr1_unordered_map=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_tr1_unordered_map" = yes; then
AC_DEFINE(HAVE_TR1_UNORDERED_MAP,,[Define if tr1/unordered_map is present. ])
fi
])
# AC_HEADER_TR1_UNORDERED_SET
AC_DEFUN([AC_HEADER_TR1_UNORDERED_SET], [
AC_CACHE_CHECK(for tr1/unordered_set,
ac_cv_cxx_tr1_unordered_set,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <tr1/unordered_set>], [using std::tr1::unordered_set;],
ac_cv_cxx_tr1_unordered_set=yes, ac_cv_cxx_tr1_unordered_set=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_tr1_unordered_set" = yes; then
AC_DEFINE(HAVE_TR1_UNORDERED_SET,,[Define if tr1/unordered_set is present. ])
fi
])
Support for C++0x dialect.
Check for baseline language coverage in the compiler for the C++0xstandard.
# AC_COMPILE_STDCXX_OX
AC_DEFUN([AC_COMPILE_STDCXX_0X], [
AC_CACHE_CHECK(if g++ supports C++0x features without additional flags,
ac_cv_cxx_compile_cxx0x_native,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
template <typename T>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
typedef check<check<bool>> right_angle_brackets;
int a;
decltype(a) b;
typedef check<int> check_type;
check_type c;
check_type&& cr = c;],,
ac_cv_cxx_compile_cxx0x_native=yes, ac_cv_cxx_compile_cxx0x_native=no)
AC_LANG_RESTORE
])
AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x,
ac_cv_cxx_compile_cxx0x_cxx,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++0x"
AC_TRY_COMPILE([
template <typename T>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
typedef check<check<bool>> right_angle_brackets;
int a;
decltype(a) b;
typedef check<int> check_type;
check_type c;
check_type&& cr = c;],,
ac_cv_cxx_compile_cxx0x_cxx=yes, ac_cv_cxx_compile_cxx0x_cxx=no)
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x,
ac_cv_cxx_compile_cxx0x_gxx,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
AC_TRY_COMPILE([
template <typename T>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
typedef check<check<bool>> right_angle_brackets;
int a;
decltype(a) b;
typedef check<int> check_type;
check_type c;
check_type&& cr = c;],,
ac_cv_cxx_compile_cxx0x_gxx=yes, ac_cv_cxx_compile_cxx0x_gxx=no)
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_compile_cxx0x_native" = yes ||
test "$ac_cv_cxx_compile_cxx0x_cxx" = yes ||
test "$ac_cv_cxx_compile_cxx0x_gxx" = yes; then
AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ])
fi
])
Check for library coverage of the C++0xstandard.
# AC_HEADER_STDCXX_0X
AC_DEFUN([AC_HEADER_STDCXX_0X], [
AC_CACHE_CHECK(for ISO C++ 0x include files,
ac_cv_cxx_stdcxx_0x,
[AC_REQUIRE([AC_COMPILE_STDCXX_0X])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
AC_TRY_COMPILE([
#include <cassert>
#include <ccomplex>
#include <cctype>
#include <cerrno>
#include <cfenv>
#include <cfloat>
#include <cinttypes>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstdbool>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctgmath>
#include <ctime>
#include <cwchar>
#include <cwctype>
#include <algorithm>
#include <array>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <tuple>
#include <typeinfo>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <valarray>
#include <vector>
],,
ac_cv_cxx_stdcxx_0x=yes, ac_cv_cxx_stdcxx_0x=no)
AC_LANG_RESTORE
CXXFLAGS="$ac_save_CXXFLAGS"
])
if test "$ac_cv_cxx_stdcxx_0x" = yes; then
AC_DEFINE(STDCXX_0X_HEADERS,,[Define if ISO C++ 0x header files are present. ])
fi
])
As is the case for TR1 support, these autoconf macros can be made for a finer-grained, per-header-file check. For <unordered_map>
# AC_HEADER_UNORDERED_MAP
AC_DEFUN([AC_HEADER_UNORDERED_MAP], [
AC_CACHE_CHECK(for unordered_map,
ac_cv_cxx_unordered_map,
[AC_REQUIRE([AC_COMPILE_STDCXX_0X])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
AC_TRY_COMPILE([#include <unordered_map>], [using std::unordered_map;],
ac_cv_cxx_unordered_map=yes, ac_cv_cxx_unordered_map=no)
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_unordered_map" = yes; then
AC_DEFINE(HAVE_UNORDERED_MAP,,[Define if unordered_map is present. ])
fi
])
# AC_HEADER_UNORDERED_SET
AC_DEFUN([AC_HEADER_UNORDERED_SET], [
AC_CACHE_CHECK(for unordered_set,
ac_cv_cxx_unordered_set,
[AC_REQUIRE([AC_COMPILE_STDCXX_0X])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
AC_TRY_COMPILE([#include <unordered_set>], [using std::unordered_set;],
ac_cv_cxx_unordered_set=yes, ac_cv_cxx_unordered_set=no)
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_unordered_set" = yes; then
AC_DEFINE(HAVE_UNORDERED_SET,,[Define if unordered_set is present. ])
fi
])
Container::iterator_type is not necessarily Container::value_type*
This is a change in behavior from the previous version. Now, most
iterator_type typedefs in container classes are POD
objects, not value_type pointers.
Bibliography
Migrating to GCC 4.1
DanKegel
Building the Whole Debian Archive with GCC 4.1: A Summary
MartinMichlmayr
Migration guide for GCC-3.2
@
1.1.1.1
log
@initial import of GCC 4.5.3 sources. changes since 4.1 are way too numerous
to review, please see http://gcc.gnu.org/gcc-4.5/changes.html (and the 4.2,
4.3 and 4.4 versions, too.)
this includes the core, c++, objc and the non java/ada/fortran parts of the
testsuite.
@
text
@@
1.1.1.1.8.1
log
@Rebase to HEAD as of a few days ago.
@
text
@d1 1
a1 2
d4 1
a4 1
Backwards Compatibility
d6 6
a11 2
ISO C++backwards
d13 1
a13 1
d15 1
d17 2
a18 3
First
d44 2
a45 2
No ios_base
d49 1
a49 3
No cout in <ostream.h>, no cin in <istream.h>
d51 2
d56 3
a58 3
<fstream.h>,
<ostream.h>
and <istream.h>
d61 1
a61 1
<iostream>
d68 2
a69 2
the GCC extensions
page describes where to find the last libg++ source. The code is
d72 2
a73 4
Second
d75 2
d98 2
a99 2
Namespace std:: not supported
d116 1
a116 1
compilers use (ignore
d182 1
a182 3
Illegal iterator usage
d184 2
d212 1
a212 1
d214 3
a216 3
isspace from <cctype> is a macro
d219 2
a220 1
Glibc 2.0.x and 2.1.x define <ctype.h> functionality as macros
d245 1
a245 1
<ctype.h> to define functions
d257 1
a257 1
Then, include <ctype.h>
d262 4
a265 4
std; declaration at the top, and include
<ctype.h>. This will
result in ambiguities between the definitions in the global namespace
(<ctype.h>) and the
d269 1
a269 3
No vector::at, deque::at, string::at
d271 2
d306 1
a306 3
No std::char_traits<char>::eof
d308 2
d323 1
a323 3
No string::clear
d325 2
d353 1
a353 1
d355 2
a356 1
d359 1
a359 2
d364 1
a364 3
No basic_stringbuf, basic_stringstream
d366 2
d371 1
a371 1
provided, (<sstream>), for
d373 2
a374 1
i/ostrstream (<strstream>) interface is also provided,
d487 2
a488 1
Another example of using stringstreams is in this howto.
d494 1
a494 1
d496 2
a497 2
Little or no wide character support
d503 1
a503 1
d505 2
a506 2
No templatized iostreams
d511 1
a511 3
Thread safety issues
d513 2
d544 4
a547 3
interpretations of what "thread-safe" means for a
library (not a general program). We currently use the same
definition that SGI uses for their STL subset. However,
d557 1
a557 1
"Thread Next" to move down the thread. This farm is in
d564 3
a566 2
Our threading expert Loren gives a breakdown of the
six situations involving threads for the 3.0
d572 2
a573 2
This message inspired a recent updating of issues with
d587 1
a587 3
d589 1
a589 1
Third
d591 2
d609 2
a610 2
Pre-ISO headers moved to backwards or removed
d613 1
a613 2
(<iostream.h>,
<defalloc.h> etc.) are
d624 2
a625 2
Marshall Cline's C++ FAQ Lite has a good explanation in item
[27.4].
d689 1
a689 1
like <vector.h> can be replaced with <vector> and a using
d694 1
a694 3
Extension headers hash_map, hash_set moved to ext or backwards
d696 2
d701 2
a702 4
In particular, the unordered_map and
unordered_set containers of TR1 and C++ 2011
are suitable replacements for the non-standard
hash_map and hash_set
d705 2
a706 2
Header files <hash_map> and <hash_set> moved
to <ext/hash_map> and <ext/hash_set>,
d708 3
a710 3
in namespace __gnu_cxx. Later versions deprecate
these files, and suggest using TR1's <unordered_map>
and <unordered_set> instead.
d784 1
a784 4
No ios::nocreate/ios::noreplace.
d786 3
d803 1
a803 1
d805 2
a806 1
d808 1
a808 2
d827 2
a828 2
<ext/stdio_filebuf.h> contains a derived class called
__gnu_cxx::stdio_filebuf.
d835 1
a835 1
fdstream example
d838 1
a838 1
d840 2
a841 1
d843 1
a843 2
d914 1
a914 1
d916 2
a917 1
d919 1
a919 2
d1005 1
a1005 2
a1006 3
Support for C++11 dialect.
d1008 4
d1013 1
a1013 1
Check for baseline language coverage in the compiler for the C++11 standard.
d1017 4
a1020 4
# AC_COMPILE_STDCXX_11
AC_DEFUN([AC_COMPILE_STDCXX_11], [
AC_CACHE_CHECK(if g++ supports C++11 features without additional flags,
ac_cv_cxx_compile_cxx11_native,
d1025 1
a1025 1
struct check final
d1027 1
a1027 1
static constexpr T value{ __cplusplus };
d1036 3
a1038 5
check_type c{};
check_type&& cr = static_cast<check_type&&>(c);
static_assert(check_type::value == 201103L, "C++11 compiler");],,
ac_cv_cxx_compile_cxx11_native=yes, ac_cv_cxx_compile_cxx11_native=no)
d1042 2
a1043 2
AC_CACHE_CHECK(if g++ supports C++11 features with -std=c++11,
ac_cv_cxx_compile_cxx11_cxx,
d1047 1
a1047 1
CXXFLAGS="$CXXFLAGS -std=c++11"
d1050 1
a1050 1
struct check final
d1052 1
a1052 1
static constexpr T value{ __cplusplus };
d1061 3
a1063 5
check_type c{};
check_type&& cr = static_cast<check_type&&>(c);
static_assert(check_type::value == 201103L, "C++11 compiler");],,
ac_cv_cxx_compile_cxx11_cxx=yes, ac_cv_cxx_compile_cxx11_cxx=no)
d1068 2
a1069 2
AC_CACHE_CHECK(if g++ supports C++11 features with -std=gnu++11,
ac_cv_cxx_compile_cxx11_gxx,
d1073 1
a1073 1
CXXFLAGS="$CXXFLAGS -std=gnu++11"
d1076 1
a1076 1
struct check final
d1078 1
a1078 1
static constexpr T value{ __cplusplus };
d1087 3
a1089 5
check_type c{};
check_type&& cr = static_cast<check_type&&>(c);
static_assert(check_type::value == 201103L, "C++11 compiler");],,
ac_cv_cxx_compile_cxx11_gxx=yes, ac_cv_cxx_compile_cxx11_gxx=no)
d1094 4
a1097 4
if test "$ac_cv_cxx_compile_cxx11_native" = yes ||
test "$ac_cv_cxx_compile_cxx11_cxx" = yes ||
test "$ac_cv_cxx_compile_cxx11_gxx" = yes; then
AC_DEFINE(HAVE_STDCXX_11,,[Define if g++ supports C++11 features. ])
d1103 1
a1103 3
Check for library coverage of the C++2011 standard.
(Some library headers are commented out in this check, they are
not currently provided by libstdc++).
d1107 5
a1111 5
# AC_HEADER_STDCXX_11
AC_DEFUN([AC_HEADER_STDCXX_11], [
AC_CACHE_CHECK(for ISO C++11 include files,
ac_cv_cxx_stdcxx_11,
[AC_REQUIRE([AC_COMPILE_STDCXX_11])
d1115 1
a1115 1
CXXFLAGS="$CXXFLAGS -std=gnu++11"
a1130 1
#include <cstdalign>
a1139 1
// #include <cuchar>
a1144 1
#include <atomic>
a1145 2
#include <chrono>
// #include <codecvt>
a1146 1
#include <condition_variable>
a1148 1
#include <forward_list>
a1150 2
#include <future>
#include <initializer_list>
a1161 1
#include <mutex>
a1166 1
#include <ratio>
a1167 1
#include <scoped_allocator>
a1173 2
#include <system_error>
#include <thread>
a1174 1
#include <typeindex>
d1183 1
a1183 1
ac_cv_cxx_stdcxx_11=yes, ac_cv_cxx_stdcxx_11=no)
d1187 2
a1188 2
if test "$ac_cv_cxx_stdcxx_11" = yes; then
AC_DEFINE(STDCXX_11_HEADERS,,[Define if ISO C++11 header files are present. ])
d1193 1
a1193 2
As is the case for TR1 support, these autoconf macros can be made for a finer-grained, per-header-file check. For
<unordered_map>
d1201 1
a1201 1
[AC_REQUIRE([AC_COMPILE_STDCXX_11])
d1205 1
a1205 1
CXXFLAGS="$CXXFLAGS -std=gnu++11"
d1222 1
a1222 1
[AC_REQUIRE([AC_COMPILE_STDCXX_11])
d1226 1
a1226 1
CXXFLAGS="$CXXFLAGS -std=gnu++11"
d1237 1
d1239 4
a1242 16
Some C++11 features first appeared in GCC 4.3 and could be enabled by
and for GCC
releases which pre-date the 2011 standard. Those C++11 features and GCC's
support for them were still changing until the 2011 standard was finished,
but the autoconf checks above could be extended to test for incomplete
C++11 support with and
.
Container::iterator_type is not necessarily Container::value_type*
d1245 1
a1245 1
This is a change in behavior from older versions. Now, most
d1249 1
a1249 1
d1251 1
a1251 3
Bibliography
d1253 2
d1257 11
a1267 8
Migrating to GCC 4.1
DanKegel
d1271 11
a1281 7
Building the Whole Debian Archive with GCC 4.1: A Summary
MartinMichlmayr
d1285 7
a1291 7
Migration guide for GCC-3.2
d1296 1
a1296 1
@
1.1.1.1.2.1
log
@sync with head.
for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.
this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
@
text
@d1 1
a1 2
d4 1
a4 1
Backwards Compatibility
d6 6
a11 2
ISO C++backwards
d13 1
a13 1
d15 1
d17 2
a18 3
First
d44 2
a45 2
No ios_base
d49 1
a49 3
No cout in <ostream.h>, no cin in <istream.h>
d51 2
d56 3
a58 3
<fstream.h>,
<ostream.h>
and <istream.h>
d61 1
a61 1
<iostream>
d68 2
a69 2
the GCC extensions
page describes where to find the last libg++ source. The code is
d72 2
a73 4
Second
d75 2
d98 2
a99 2
Namespace std:: not supported
d116 1
a116 1
compilers use (ignore
d182 1
a182 3
Illegal iterator usage
d184 2
d212 1
a212 1
d214 3
a216 3
isspace from <cctype> is a macro
d219 2
a220 1
Glibc 2.0.x and 2.1.x define <ctype.h> functionality as macros
d245 1
a245 1
<ctype.h> to define functions
d257 1
a257 1
Then, include <ctype.h>
d262 4
a265 4
std; declaration at the top, and include
<ctype.h>. This will
result in ambiguities between the definitions in the global namespace
(<ctype.h>) and the
d269 1
a269 3
No vector::at, deque::at, string::at
d271 2
d306 1
a306 3
No std::char_traits<char>::eof
d308 2
d323 1
a323 3
No string::clear
d325 2
d353 1
a353 1
d355 2
a356 1
d359 1
a359 2
d364 1
a364 3
No basic_stringbuf, basic_stringstream
d366 2
d371 1
a371 1
provided, (<sstream>), for
d373 2
a374 1
i/ostrstream (<strstream>) interface is also provided,
d487 2
a488 1
Another example of using stringstreams is in this howto.
d494 1
a494 1
d496 2
a497 2
Little or no wide character support
d503 1
a503 1
d505 2
a506 2
No templatized iostreams
d511 1
a511 3
Thread safety issues
d513 2
d544 4
a547 3
interpretations of what "thread-safe" means for a
library (not a general program). We currently use the same
definition that SGI uses for their STL subset. However,
d557 1
a557 1
"Thread Next" to move down the thread. This farm is in
d564 3
a566 2
Our threading expert Loren gives a breakdown of the
six situations involving threads for the 3.0
d572 2
a573 2
This message inspired a recent updating of issues with
d587 1
a587 3
d589 1
a589 1
Third
d591 2
d609 2
a610 2
Pre-ISO headers moved to backwards or removed
d613 1
a613 2
(<iostream.h>,
<defalloc.h> etc.) are
d624 2
a625 2
Marshall Cline's C++ FAQ Lite has a good explanation in item
[27.4].
d689 1
a689 1
like <vector.h> can be replaced with <vector> and a using
d694 1
a694 3
Extension headers hash_map, hash_set moved to ext or backwards
d696 2
d701 2
a702 4
In particular, the unordered_map and
unordered_set containers of TR1 and C++ 2011
are suitable replacements for the non-standard
hash_map and hash_set
d705 2
a706 2
Header files <hash_map> and <hash_set> moved
to <ext/hash_map> and <ext/hash_set>,
d708 3
a710 3
in namespace __gnu_cxx. Later versions deprecate
these files, and suggest using TR1's <unordered_map>
and <unordered_set> instead.
d784 1
a784 4
No ios::nocreate/ios::noreplace.
d786 3
d803 1
a803 1
d805 2
a806 1
d808 1
a808 2
d827 2
a828 2
<ext/stdio_filebuf.h> contains a derived class called
__gnu_cxx::stdio_filebuf.
d835 1
a835 1
fdstream example
d838 1
a838 1
d840 2
a841 1
d843 1
a843 2
d914 1
a914 1
d916 2
a917 1
d919 1
a919 2
d1005 1
a1005 2
a1006 3
Support for C++11 dialect.
d1008 4
d1013 1
a1013 1
Check for baseline language coverage in the compiler for the C++11 standard.
d1017 4
a1020 4
# AC_COMPILE_STDCXX_11
AC_DEFUN([AC_COMPILE_STDCXX_11], [
AC_CACHE_CHECK(if g++ supports C++11 features without additional flags,
ac_cv_cxx_compile_cxx11_native,
d1025 1
a1025 1
struct check final
d1027 1
a1027 1
static constexpr T value{ __cplusplus };
d1036 3
a1038 5
check_type c{};
check_type&& cr = static_cast<check_type&&>(c);
static_assert(check_type::value == 201103L, "C++11 compiler");],,
ac_cv_cxx_compile_cxx11_native=yes, ac_cv_cxx_compile_cxx11_native=no)
d1042 2
a1043 2
AC_CACHE_CHECK(if g++ supports C++11 features with -std=c++11,
ac_cv_cxx_compile_cxx11_cxx,
d1047 1
a1047 1
CXXFLAGS="$CXXFLAGS -std=c++11"
d1050 1
a1050 1
struct check final
d1052 1
a1052 1
static constexpr T value{ __cplusplus };
d1061 3
a1063 5
check_type c{};
check_type&& cr = static_cast<check_type&&>(c);
static_assert(check_type::value == 201103L, "C++11 compiler");],,
ac_cv_cxx_compile_cxx11_cxx=yes, ac_cv_cxx_compile_cxx11_cxx=no)
d1068 2
a1069 2
AC_CACHE_CHECK(if g++ supports C++11 features with -std=gnu++11,
ac_cv_cxx_compile_cxx11_gxx,
d1073 1
a1073 1
CXXFLAGS="$CXXFLAGS -std=gnu++11"
d1076 1
a1076 1
struct check final
d1078 1
a1078 1
static constexpr T value{ __cplusplus };
d1087 3
a1089 5
check_type c{};
check_type&& cr = static_cast<check_type&&>(c);
static_assert(check_type::value == 201103L, "C++11 compiler");],,
ac_cv_cxx_compile_cxx11_gxx=yes, ac_cv_cxx_compile_cxx11_gxx=no)
d1094 4
a1097 4
if test "$ac_cv_cxx_compile_cxx11_native" = yes ||
test "$ac_cv_cxx_compile_cxx11_cxx" = yes ||
test "$ac_cv_cxx_compile_cxx11_gxx" = yes; then
AC_DEFINE(HAVE_STDCXX_11,,[Define if g++ supports C++11 features. ])
d1103 1
a1103 3
Check for library coverage of the C++2011 standard.
(Some library headers are commented out in this check, they are
not currently provided by libstdc++).
d1107 5
a1111 5
# AC_HEADER_STDCXX_11
AC_DEFUN([AC_HEADER_STDCXX_11], [
AC_CACHE_CHECK(for ISO C++11 include files,
ac_cv_cxx_stdcxx_11,
[AC_REQUIRE([AC_COMPILE_STDCXX_11])
d1115 1
a1115 1
CXXFLAGS="$CXXFLAGS -std=gnu++11"
a1130 1
#include <cstdalign>
a1139 1
// #include <cuchar>
a1144 1
#include <atomic>
a1145 2
#include <chrono>
// #include <codecvt>
a1146 1
#include <condition_variable>
a1148 1
#include <forward_list>
a1150 2
#include <future>
#include <initializer_list>
a1161 1
#include <mutex>
a1166 1
#include <ratio>
a1167 1
#include <scoped_allocator>
a1173 2
#include <system_error>
#include <thread>
a1174 1
#include <typeindex>
d1183 1
a1183 1
ac_cv_cxx_stdcxx_11=yes, ac_cv_cxx_stdcxx_11=no)
d1187 2
a1188 2
if test "$ac_cv_cxx_stdcxx_11" = yes; then
AC_DEFINE(STDCXX_11_HEADERS,,[Define if ISO C++11 header files are present. ])
d1193 1
a1193 2
As is the case for TR1 support, these autoconf macros can be made for a finer-grained, per-header-file check. For
<unordered_map>
d1201 1
a1201 1
[AC_REQUIRE([AC_COMPILE_STDCXX_11])
d1205 1
a1205 1
CXXFLAGS="$CXXFLAGS -std=gnu++11"
d1222 1
a1222 1
[AC_REQUIRE([AC_COMPILE_STDCXX_11])
d1226 1
a1226 1
CXXFLAGS="$CXXFLAGS -std=gnu++11"
d1237 1
d1239 4
a1242 16
Some C++11 features first appeared in GCC 4.3 and could be enabled by
and for GCC
releases which pre-date the 2011 standard. Those C++11 features and GCC's
support for them were still changing until the 2011 standard was finished,
but the autoconf checks above could be extended to test for incomplete
C++11 support with and
.
Container::iterator_type is not necessarily Container::value_type*
d1245 1
a1245 1
This is a change in behavior from older versions. Now, most
d1249 1
a1249 1
d1251 1
a1251 3
Bibliography
d1253 2
d1257 11
a1267 8
Migrating to GCC 4.1
DanKegel
d1271 11
a1281 7
Building the Whole Debian Archive with GCC 4.1: A Summary
MartinMichlmayr
d1285 7
a1291 7
Migration guide for GCC-3.2
d1296 1
a1296 1
@
1.1.1.2
log
@import GCC 4.8 branch at r206687.
highlights from: http://gcc.gnu.org/gcc-4.6/changes.html
GCC now has stricter checks for invalid command-line options
New -Wunused-but-set-variable and -Wunused-but-set-parameter
warnings
Many platforms have been obsoleted
Link-time optimization improvements
A new switch -fstack-usage has been added
A new function attribute leaf was introduced
A new warning, enabled by -Wdouble-promotion
Support for selectively enabling and disabling warnings via
#pragma GCC diagnostic has been added
There is now experimental support for some features from the
upcoming C1X revision of the ISO C standard
Improved experimental support for the upcoming C++0x ISO C++
standard
G++ now issues clearer diagnostics in several cases
Updates for ARM, x86, MIPS, PPC/PPC64, SPARC
Darwin, FreeBSD, Solaris 2, MinGW and Cygwin now all support
__float128 on 32-bit and 64-bit x86 targets. [*1]
highlights from: http://gcc.gnu.org/gcc-4.7/changes.html
The -fconserve-space flag has been deprecated
Support for a new parameter --param case-values-threshold=n
was added
Interprocedural and Link-time optimization improvements
A new built-in, __builtin_assume_aligned, has been added
A new warning option -Wunused-local-typedefs was added
A new experimental command-line option -ftrack-macro-expansion
was added
Support for atomic operations specifying the C++11/C11 memory
model has been added
There is support for some more features from the C11 revision
of the ISO C standard
Improved experimental support for the new ISO C++ standard,
C++11
Updates for ARM, x86, MIPS, PPC/PPC64, SH, SPARC, TILE*
A new option (-grecord-gcc-switches) was added
highlights from: http://gcc.gnu.org/gcc-4.8/changes.html
GCC now uses C++ as its implementation language. This means
that to build GCC from sources, you will need a C++
compiler that understands C++ 2003
DWARF4 is now the default when generating DWARF debug
information
A new general optimization level, -Og, has been introduced
A new option -ftree-partial-pre was added
The option -fconserve-space has been removed
The command-line options -fipa-struct-reorg and
-fipa-matrix-reorg have been removed
Interprocedural and Link-time optimization improvements
AddressSanitizer, a fast memory error detector, has been
added [*2]
A new -Wsizeof-pointer-memaccess warning has been added
G++ now supports a -std=c++1y option for experimentation
with features proposed for the next revision of the
standard, expected around 2014
Improved experimental support for the new ISO C++ standard,
C++11
A new port has been added to support AArch64
Updates for ARM, x86, MIPS, PPC/PPC64, SH, SPARC, TILE*
[*1] we should support this too!
[*2] we should look into this.
https://code.google.com/p/address-sanitizer/
@
text
@d1 1
a1 2
d4 1
a4 1
Backwards Compatibility
d6 6
a11 2
ISO C++backwards
d13 1
a13 1
d15 1
d17 2
a18 3
First
d44 2
a45 2
No ios_base
d49 1
a49 3
No cout in <ostream.h>, no cin in <istream.h>
d51 2
d56 3
a58 3
<fstream.h>,
<ostream.h>
and <istream.h>
d61 1
a61 1
<iostream>
d68 2
a69 2
the GCC extensions
page describes where to find the last libg++ source. The code is
d72 2
a73 4
Second
d75 2
d98 2
a99 2
Namespace std:: not supported
d116 1
a116 1
compilers use (ignore
d182 1
a182 3
Illegal iterator usage
d184 2
d212 1
a212 1
d214 3
a216 3
isspace from <cctype> is a macro
d219 2
a220 1
Glibc 2.0.x and 2.1.x define <ctype.h> functionality as macros
d245 1
a245 1
<ctype.h> to define functions
d257 1
a257 1
Then, include <ctype.h>
d262 4
a265 4
std; declaration at the top, and include
<ctype.h>. This will
result in ambiguities between the definitions in the global namespace
(<ctype.h>) and the
d269 1
a269 3
No vector::at, deque::at, string::at
d271 2
d306 1
a306 3
No std::char_traits<char>::eof
d308 2
d323 1
a323 3
No string::clear
d325 2
d353 1
a353 1
d355 2
a356 1
d359 1
a359 2
d364 1
a364 3
No basic_stringbuf, basic_stringstream
d366 2
d371 1
a371 1
provided, (<sstream>), for
d373 2
a374 1
i/ostrstream (<strstream>) interface is also provided,
d487 2
a488 1
Another example of using stringstreams is in this howto.
d494 1
a494 1
d496 2
a497 2
Little or no wide character support
d503 1
a503 1
d505 2
a506 2
No templatized iostreams
d511 1
a511 3
Thread safety issues
d513 2
d544 4
a547 3
interpretations of what "thread-safe" means for a
library (not a general program). We currently use the same
definition that SGI uses for their STL subset. However,
d557 1
a557 1
"Thread Next" to move down the thread. This farm is in
d564 3
a566 2
Our threading expert Loren gives a breakdown of the
six situations involving threads for the 3.0
d572 2
a573 2
This message inspired a recent updating of issues with
d587 1
a587 3
d589 1
a589 1
Third
d591 2
d609 2
a610 2
Pre-ISO headers moved to backwards or removed
d613 1
a613 2
(<iostream.h>,
<defalloc.h> etc.) are
d624 2
a625 2
Marshall Cline's C++ FAQ Lite has a good explanation in item
[27.4].
d689 1
a689 1
like <vector.h> can be replaced with <vector> and a using
d694 1
a694 3
Extension headers hash_map, hash_set moved to ext or backwards
d696 2
d701 2
a702 4
In particular, the unordered_map and
unordered_set containers of TR1 and C++ 2011
are suitable replacements for the non-standard
hash_map and hash_set
d705 2
a706 2
Header files <hash_map> and <hash_set> moved
to <ext/hash_map> and <ext/hash_set>,
d708 3
a710 3
in namespace __gnu_cxx. Later versions deprecate
these files, and suggest using TR1's <unordered_map>
and <unordered_set> instead.
d784 1
a784 4
No ios::nocreate/ios::noreplace.
d786 3
d803 1
a803 1
d805 2
a806 1
d808 1
a808 2
d827 2
a828 2
<ext/stdio_filebuf.h> contains a derived class called
__gnu_cxx::stdio_filebuf.
d835 1
a835 1
fdstream example
d838 1
a838 1
d840 2
a841 1
d843 1
a843 2
d914 1
a914 1
d916 2
a917 1
d919 1
a919 2
d1005 1
a1005 2
a1006 3
Support for C++11 dialect.
d1008 4
d1013 1
a1013 1
Check for baseline language coverage in the compiler for the C++11 standard.
d1017 4
a1020 4
# AC_COMPILE_STDCXX_11
AC_DEFUN([AC_COMPILE_STDCXX_11], [
AC_CACHE_CHECK(if g++ supports C++11 features without additional flags,
ac_cv_cxx_compile_cxx11_native,
d1025 1
a1025 1
struct check final
d1027 1
a1027 1
static constexpr T value{ __cplusplus };
d1036 3
a1038 5
check_type c{};
check_type&& cr = static_cast<check_type&&>(c);
static_assert(check_type::value == 201103L, "C++11 compiler");],,
ac_cv_cxx_compile_cxx11_native=yes, ac_cv_cxx_compile_cxx11_native=no)
d1042 2
a1043 2
AC_CACHE_CHECK(if g++ supports C++11 features with -std=c++11,
ac_cv_cxx_compile_cxx11_cxx,
d1047 1
a1047 1
CXXFLAGS="$CXXFLAGS -std=c++11"
d1050 1
a1050 1
struct check final
d1052 1
a1052 1
static constexpr T value{ __cplusplus };
d1061 3
a1063 5
check_type c{};
check_type&& cr = static_cast<check_type&&>(c);
static_assert(check_type::value == 201103L, "C++11 compiler");],,
ac_cv_cxx_compile_cxx11_cxx=yes, ac_cv_cxx_compile_cxx11_cxx=no)
d1068 2
a1069 2
AC_CACHE_CHECK(if g++ supports C++11 features with -std=gnu++11,
ac_cv_cxx_compile_cxx11_gxx,
d1073 1
a1073 1
CXXFLAGS="$CXXFLAGS -std=gnu++11"
d1076 1
a1076 1
struct check final
d1078 1
a1078 1
static constexpr T value{ __cplusplus };
d1087 3
a1089 5
check_type c{};
check_type&& cr = static_cast<check_type&&>(c);
static_assert(check_type::value == 201103L, "C++11 compiler");],,
ac_cv_cxx_compile_cxx11_gxx=yes, ac_cv_cxx_compile_cxx11_gxx=no)
d1094 4
a1097 4
if test "$ac_cv_cxx_compile_cxx11_native" = yes ||
test "$ac_cv_cxx_compile_cxx11_cxx" = yes ||
test "$ac_cv_cxx_compile_cxx11_gxx" = yes; then
AC_DEFINE(HAVE_STDCXX_11,,[Define if g++ supports C++11 features. ])
d1103 1
a1103 3
Check for library coverage of the C++2011 standard.
(Some library headers are commented out in this check, they are
not currently provided by libstdc++).
d1107 5
a1111 5
# AC_HEADER_STDCXX_11
AC_DEFUN([AC_HEADER_STDCXX_11], [
AC_CACHE_CHECK(for ISO C++11 include files,
ac_cv_cxx_stdcxx_11,
[AC_REQUIRE([AC_COMPILE_STDCXX_11])
d1115 1
a1115 1
CXXFLAGS="$CXXFLAGS -std=gnu++11"
a1130 1
#include <cstdalign>
a1139 1
// #include <cuchar>
a1144 1
#include <atomic>
a1145 2
#include <chrono>
// #include <codecvt>
a1146 1
#include <condition_variable>
a1148 1
#include <forward_list>
a1150 2
#include <future>
#include <initializer_list>
a1161 1
#include <mutex>
a1166 1
#include <ratio>
a1167 1
#include <scoped_allocator>
a1173 2
#include <system_error>
#include <thread>
a1174 1
#include <typeindex>
d1183 1
a1183 1
ac_cv_cxx_stdcxx_11=yes, ac_cv_cxx_stdcxx_11=no)
d1187 2
a1188 2
if test "$ac_cv_cxx_stdcxx_11" = yes; then
AC_DEFINE(STDCXX_11_HEADERS,,[Define if ISO C++11 header files are present. ])
d1193 1
a1193 2
As is the case for TR1 support, these autoconf macros can be made for a finer-grained, per-header-file check. For
<unordered_map>
d1201 1
a1201 1
[AC_REQUIRE([AC_COMPILE_STDCXX_11])
d1205 1
a1205 1
CXXFLAGS="$CXXFLAGS -std=gnu++11"
d1222 1
a1222 1
[AC_REQUIRE([AC_COMPILE_STDCXX_11])
d1226 1
a1226 1
CXXFLAGS="$CXXFLAGS -std=gnu++11"
d1237 1
d1239 4
a1242 16
Some C++11 features first appeared in GCC 4.3 and could be enabled by
and for GCC
releases which pre-date the 2011 standard. Those C++11 features and GCC's
support for them were still changing until the 2011 standard was finished,
but the autoconf checks above could be extended to test for incomplete
C++11 support with and
.
Container::iterator_type is not necessarily Container::value_type*
d1245 1
a1245 1
This is a change in behavior from older versions. Now, most
d1249 1
a1249 1
d1251 1
a1251 3
Bibliography
d1253 2
d1257 11
a1267 8
Migrating to GCC 4.1
DanKegel
d1271 11
a1281 7
Building the Whole Debian Archive with GCC 4.1: A Summary
MartinMichlmayr
d1285 7
a1291 7
Migration guide for GCC-3.2
d1296 1
a1296 1
@
1.1.1.3
log
@import GCC 5.3.0. see these urls for details which are too large to
include here:
http://gcc.gnu.org/gcc-4.9/changes.html
http://gcc.gnu.org/gcc-5/changes.html
(note that GCC 5.x is a release stream like GCC 4.9.x, 4.8.x, etc.)
the main issues we will have are:
The default mode for C is now -std=gnu11 instead of -std=gnu89.
ARM:
The deprecated option -mwords-little-endian has been removed.
The options -mapcs, -mapcs-frame, -mtpcs-frame and -mtpcs-leaf-frame
which are only applicable to the old ABI have been deprecated.
MIPS:
The o32 ABI has been modified and extended. The o32 64-bit
floating-point register support is now obsolete and has been removed.
It has been replaced by three ABI extensions FPXX, FP64A, and FP64.
The meaning of the -mfp64 command-line option has changed. It is now
used to enable the FP64A and FP64 ABI extensions.
@
text
@d415 1
a415 1
oss << "Name=" << m_name << ", number=" << m_number << std::endl;
d591 1
a591 1
(clauses 23 through 25, mostly) is adapted from the final release
d617 2
a618 2
Marshall Cline's C++ FAQ Lite has a good explanation in What's
the difference between <xxx> and <xxx.h> headers?.
d785 12
a796 19
Historically these flags were used with iostreams to control whether
new files are created or not when opening a file stream, similar to the
O_CREAT and O_EXCL flags for the
open(2) system call. Because iostream modes correspond
to fopen(3) modes these flags are not supported.
For input streams a new file will not be created anyway, so
ios::nocreate is not needed.
For output streams, a new file will be created if it does not exist, which is
consistent with the behaviour of fopen.
When one of these flags is needed a possible alternative is to attempt
to open the file using std::ifstream first to determine whether
the file already exists or not. This may not be reliable however, because
whether the file exists or not could change between opening the
std::istream and re-opening with an output stream. If you need
to check for existence and open a file as a single operation then you will
need to use OS-specific facilities outside the C++ standard library, such
as open(2).
@
1.1.1.3.16.1
log
@Sync with HEAD
@
text
@d601 1
a601 1
Pre-ISO headers removed
d607 2
a608 1
not supported.
d611 7
a617 3
For those of you new to ISO C++ (welcome, time travelers!), the
ancient pre-ISO headers have new names.
The C++ FAQ has a good explanation in What's
d621 60
d1307 1
a1307 1
xlink:href="https://lists.debian.org/debian-gcc/2006/03/msg00405.html">
@
1.1.1.3.16.2
log
@Mostly merge changes from HEAD upto 20200411
@
text
@d539 1
a539 1
library (not a general program). We currently use the same
@
1.1.1.3.14.1
log
@Sync with HEAD
@
text
@d601 1
a601 1
Pre-ISO headers removed
d607 2
a608 1
not supported.
d611 7
a617 3
For those of you new to ISO C++ (welcome, time travelers!), the
ancient pre-ISO headers have new names.
The C++ FAQ has a good explanation in What's
d621 60
d1307 1
a1307 1
xlink:href="https://lists.debian.org/debian-gcc/2006/03/msg00405.html">
@
1.1.1.4
log
@import GCC 7.4.0. main changes include:
The non-standard C++0x type traits has_trivial_default_constructor,
has_trivial_copy_constructor and has_trivial_copy_assign have been
removed.
On ARM targets (arm*-*-*), a bug introduced in GCC 5 that affects
conformance to the procedure call standard (AAPCS) has been fixed.
Many optimiser improvements
DWARF-5 support.
Many new and enhanced warnings.
Warnings about format strings now underline the pertinent part of
the string, and can offer suggested fixes.
Several new warnings related to buffer overflows and buffer
truncation.
New __builtin_add_overflow_p, __builtin_sub_overflow_p,
__builtin_mul_overflow_p built-ins added that test for overflow.
The C++ front end has experimental support for all of the current
C++17 draft.
The -fverbose-asm option has been expanded to prints comments
showing the source lines that correspond to the assembly.
The gcc and g++ driver programs will now provide suggestions for
misspelled arguments to command-line options.
AArch64 specific:
GCC has been updated to the latest revision of the procedure call
standard (AAPCS64) to provide support for parameter passing when
data types have been over-aligned.
The ARMv8.2-A and ARMv8.3-A architecture are now supported.
ARM specific:
Support for the ARMv5 and ARMv5E architectures has been
deprecated (which have no known implementations).
A new command-line option -mpure-code has been added. It does not
allow constant data to be placed in code sections.
x86 specific:
Support for the AVX-512 4FMAPS, 4VNNIW, VPOPCNTDQ and Software
Guard Extensions (SGX) ISA extensions has been added.
PPC specific:
GCC now diagnoses inline assembly that clobbers register r2.
RISC-V specific:
Support for the RISC-V instruction set has been added.
SH specific:
Support for SH5/SH64 has been removed.
Support for SH2A has been enhanced.
@
text
@d601 1
a601 1
Pre-ISO headers removed
d607 2
a608 1
not supported.
d611 7
a617 3
For those of you new to ISO C++ (welcome, time travelers!), the
ancient pre-ISO headers have new names.
The C++ FAQ has a good explanation in What's
d621 60
d1307 1
a1307 1
xlink:href="https://lists.debian.org/debian-gcc/2006/03/msg00405.html">
@
1.1.1.5
log
@import GCC 8.3. it includes these new features:
- many optimisations improved: inter-procedural, profile-directed,
LTO, loops including user-controllable unroll support, and more.
- columns numbers added to line numbers in dwarf
- gcov extended significantly
- many sanitizer updates
- many new warning messages
- many better hints and more useful error messages
- minor ABI changes on x86-64 libstdc++, and some c++17 modes
- draft c++2a features
- better c++17 experimental support
- Armv8.4-A supported, better 8.2-A and 8.3-A support, including
32 bit arm port. cortex a-55, a-75 and a-55.a-75 combo support.
- in the GCC bugzilla, 8.1 shows 1149 bugs fixed, 8.2 shows 100, and
8.3 shows 158.
@
text
@d539 1
a539 1
library (not a general program). We currently use the same
@
1.1.1.6
log
@import GCC 7.5.0. doing this here so that the vendor branch has
the code we'll merge into gcc.old and the netbsd-9 tree gcc tree.
GCC 8.4.0 will be imported immediately on top of this again,
restoring the current status.
these PRs in the GCC bugzilla are fixed with this update:
89869 80693 89795 84272 85593 86669 87148 87647 87895 88103 88107 88563
88870 88976 89002 89187 89195 89234 89303 89314 89354 89361 89403 89412
89512 89520 89590 89621 89663 89679 89704 89734 89872 89933 90090 90208
87075 85870 89009 89242 88167 80864 81933 85890 86608 87145 88857 89024
89119 89214 89511 89612 89705 89400 81740 82186 84552 86554 87609 88105
88149 88415 88739 88903 89135 89223 89296 89505 89572 89677 89698 89710
90006 90020 90071 90328 90474 91126 91162 91812 91887 90075 88998 89945
87047 87506 88074 88656 88740 91137 89008 84010 89349 91136 91347 91995
89397 87030 60702 78884 85594 87649 87725 88181 88470 88553 88568 88588
88620 88644 88906 88949 89246 89587 89726 89768 89796 89998 90108 90756
90950 91704 88825 88983 86538 51333 89446 90220 91308 92143 89392 90213
90278 91131 91200 91510 89037 91481 87673 88418 88938 88948 90547 27221
58321 61250 67183 67958 77583 83531 86215 88648 88720 88726 89091 89466
89629 90105 90329 90585 90760 90924 91087 89222 81956 71861 35031 69455
81849 82993 85798 88138 88155 88169 88205 88206 88228 88249 88269 88376
77703 80260 82077 86248 88393 90786 57048 66089 66695 67679 68009 71723
72714 84394 85544 87734 88298 90937 91557 63891 64132 65342 68649 68717
71066 71860 71935 77746 78421 78645 78865 78983 79485 79540 85953 88326
89651 90744
@
text
@d539 1
a539 1
library (not a general program). We currently use the same
@
1.1.1.7
log
@re-import GCC 8.4.0.
@
text
@d539 1
a539 1
library (not a general program). We currently use the same
@
1.1.1.8
log
@initial import of GCC 9.3.0. changes include:
- live patching support
- shell completion help
- generally better diagnostic output (less verbose/more useful)
- diagnostics and optimisation choices can be emitted in json
- asan memory usage reduction
- many general, and specific to switch, inter-procedure,
profile and link-time optimisations. from the release notes:
"Overall compile time of Firefox 66 and LibreOffice 6.2.3 on
an 8-core machine was reduced by about 5% compared to GCC 8.3"
- OpenMP 5.0 support
- better spell-guesser
- partial experimental support for c2x and c++2a
- c++17 is no longer experimental
- arm AAPCS GCC 6-8 structure passing bug fixed, may cause
incompatibility (restored compat with GCC 5 and earlier.)
- openrisc support
@
text
@d764 2
a765 3
<ext/stdio_filebuf.h>
contains a derived class called
__gnu_cxx::stdio_filebuf.
@
1.1.1.9
log
@initial import of GCC 12.3.0.
major changes in GCC 11 included:
- The default mode for C++ is now -std=gnu++17 instead of -std=gnu++14.
- When building GCC itself, the host compiler must now support C++11,
rather than C++98.
- Some short options of the gcov tool have been renamed: -i to -j and
-j to -H.
- ThreadSanitizer improvements.
- Introduce Hardware-assisted AddressSanitizer support.
- For targets that produce DWARF debugging information GCC now defaults
to DWARF version 5. This can produce up to 25% more compact debug
information compared to earlier versions.
- Many optimisations.
- The existing malloc attribute has been extended so that it can be
used to identify allocator/deallocator API pairs. A pair of new
-Wmismatched-dealloc and -Wmismatched-new-delete warnings are added.
- Other new warnings:
-Wsizeof-array-div, enabled by -Wall, warns about divisions of two
sizeof operators when the first one is applied to an array and the
divisor does not equal the size of the array element.
-Wstringop-overread, enabled by default, warns about calls to string
functions reading past the end of the arrays passed to them as
arguments.
-Wtsan, enabled by default, warns about unsupported features in
ThreadSanitizer (currently std::atomic_thread_fence).
- Enchanced warnings:
-Wfree-nonheap-object detects many more instances of calls to
deallocation functions with pointers not returned from a dynamic
memory allocation function.
-Wmaybe-uninitialized diagnoses passing pointers or references to
uninitialized memory to functions taking const-qualified arguments.
-Wuninitialized detects reads from uninitialized dynamically
allocated memory.
-Warray-parameter warns about functions with inconsistent array forms.
-Wvla-parameter warns about functions with inconsistent VLA forms.
- Several new features from the upcoming C2X revision of the ISO C
standard are supported with -std=c2x and -std=gnu2x.
- Several C++20 features have been implemented.
- The C++ front end has experimental support for some of the upcoming
C++23 draft.
- Several new C++ warnings.
- Enhanced Arm, AArch64, x86, and RISC-V CPU support.
- The implementation of how program state is tracked within
-fanalyzer has been completely rewritten with many enhancements.
see https://gcc.gnu.org/gcc-11/changes.html for a full list.
major changes in GCC 12 include:
- An ABI incompatibility between C and C++ when passing or returning
by value certain aggregates containing zero width bit-fields has
been discovered on various targets. x86-64, ARM and AArch64
will always ignore them (so there is a C ABI incompatibility
between GCC 11 and earlier with GCC 12 or later), PowerPC64 ELFv2
always take them into account (so there is a C++ ABI
incompatibility, GCC 4.4 and earlier compatible with GCC 12 or
later, incompatible with GCC 4.5 through GCC 11). RISC-V has
changed the handling of these already starting with GCC 10. As
the ABI requires, MIPS takes them into account handling function
return values so there is a C++ ABI incompatibility with GCC 4.5
through 11.
- STABS: Support for emitting the STABS debugging format is
deprecated and will be removed in the next release. All ports now
default to emit DWARF (version 2 or later) debugging info or are
obsoleted.
- Vectorization is enabled at -O2 which is now equivalent to the
original -O2 -ftree-vectorize -fvect-cost-model=very-cheap.
- GCC now supports the ShadowCallStack sanitizer.
- Support for __builtin_shufflevector compatible with the clang
language extension was added.
- Support for attribute unavailable was added.
- Support for __builtin_dynamic_object_size compatible with the
clang language extension was added.
- New warnings:
-Wbidi-chars warns about potentially misleading UTF-8
bidirectional control characters.
-Warray-compare warns about comparisons between two operands of
array type.
- Some new features from the upcoming C2X revision of the ISO C
standard are supported with -std=c2x and -std=gnu2x.
- Several C++23 features have been implemented.
- Many C++ enhancements across warnings and -f options.
see https://gcc.gnu.org/gcc-12/changes.html for a full list.
@
text
@d1 1
a1 1
std::list<T> and do not need to be
d37 8
a44 4
That project is no longer maintained or supported, and the sources
archived. For the desperate, the
ftp.gnu.org
server still has the libg++ source.
d48 24
d83 350
a432 1
The STL portions of that library are based on SGI/HP STL release 3.11.
d435 46
d482 1
a482 2
That project is no longer maintained or supported, and the sources
archived. The code was replaced and rewritten for libstdc++-v3.
d485 96
d591 1
a591 1
(clauses 23 through 25 in C++98, mostly) is adapted from the final release
d1226 36
@